We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46a1004 commit 71f2989Copy full SHA for 71f2989
src/utils/dependencies.ts
@@ -1,6 +1,7 @@
1
import { addDependency } from 'nypm'
2
import { logger } from './dev'
3
import nuxtContentContext from './context'
4
+import { tryUseNuxt } from '@nuxt/kit'
5
6
export async function isPackageInstalled(packageName: string) {
7
try {
@@ -27,7 +28,9 @@ export async function ensurePackageInstalled(pkg: string) {
27
28
process.exit(1)
29
}
30
- await addDependency(pkg)
31
+ await addDependency(pkg, {
32
+ cwd: tryUseNuxt()?.options.rootDir,
33
+ })
34
35
36
0 commit comments