diff --git a/.changeset/neat-toes-doubt.md b/.changeset/neat-toes-doubt.md new file mode 100644 index 0000000..17b614a --- /dev/null +++ b/.changeset/neat-toes-doubt.md @@ -0,0 +1,7 @@ +--- +"@modern-js/codesmith": patch +--- + +fix: remove custom registry end / + +fix: 移除自定义 registry 结尾 / diff --git a/packages/core/src/utils/getNpmPackageInfo.ts b/packages/core/src/utils/getNpmPackageInfo.ts index c652154..8da3bd6 100644 --- a/packages/core/src/utils/getNpmPackageInfo.ts +++ b/packages/core/src/utils/getNpmPackageInfo.ts @@ -28,7 +28,7 @@ export async function getNpmPackageInfo( } const { registryUrl = await getNpmRegistry() } = options || {}; - const url = `${registryUrl}/${pkgName}/${pkgVersion}`; + const url = `${registryUrl.replace(/\/$/, '')}/${pkgName}/${pkgVersion}`; const response = await timeoutPromise( axios.get(url),