Skip to content

Commit 71f2989

Browse files
Eazashfarnabaz
andauthored
fix: add dependency at Nuxt root dir (#3525)
Co-authored-by: Farnabaz <[email protected]>
1 parent 46a1004 commit 71f2989

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/dependencies.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { addDependency } from 'nypm'
22
import { logger } from './dev'
33
import nuxtContentContext from './context'
4+
import { tryUseNuxt } from '@nuxt/kit'
45

56
export async function isPackageInstalled(packageName: string) {
67
try {
@@ -27,7 +28,9 @@ export async function ensurePackageInstalled(pkg: string) {
2728
process.exit(1)
2829
}
2930

30-
await addDependency(pkg)
31+
await addDependency(pkg, {
32+
cwd: tryUseNuxt()?.options.rootDir,
33+
})
3134
}
3235
}
3336

0 commit comments

Comments
 (0)