Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/utils/dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { addDependency } from 'nypm'
import { logger } from './dev'
import nuxtContentContext from './context'
import { tryUseNuxt } from '@nuxt/kit'

export async function isPackageInstalled(packageName: string) {
try {
Expand All @@ -27,7 +28,9 @@ export async function ensurePackageInstalled(pkg: string) {
process.exit(1)
}

await addDependency(pkg)
await addDependency(pkg, {
cwd: tryUseNuxt()?.options.rootDir,
})
}
}

Expand Down
Loading