We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
/
1 parent 7d89c7f commit b462713Copy full SHA for b462713
src/commands/module/add.ts
@@ -6,6 +6,7 @@ import { defineCommand } from 'citty'
6
import { resolve } from 'pathe'
7
import consola from 'consola'
8
import { addDependency } from 'nypm'
9
+import { joinURL } from 'ufo'
10
import { $fetch } from 'ofetch'
11
import { satisfies } from 'semver'
12
import { updateConfig } from 'c12/update'
@@ -221,7 +222,7 @@ async function resolveModule(
221
222
// Fetch package on npm
223
pkgVersion = pkgVersion || 'latest'
224
const registry = await detectNpmRegistry()
- const pkg = await $fetch(`${registry}/${pkgName}/${pkgVersion}`)
225
+ const pkg = await $fetch(joinURL(registry, `${pkgName}/${pkgVersion}`))
226
const pkgDependencies = Object.assign(
227
pkg.dependencies || {},
228
pkg.devDependencies || {},
0 commit comments