Skip to content

Commit

Permalink
feat: enhance module resolution paths for getPackageInfo (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanchien8125 authored Jan 2, 2025
1 parent 2e6b4e4 commit 04269d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/devtools/src/npm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export async function checkForUpdateOf(name: string, current?: string, nuxt = us
try {
if (!current) {
const require = createRequire(nuxt.options.rootDir)
const info = await getPackageInfo(name, { paths: require.resolve.paths(name) || undefined })
const modulePaths = [
...nuxt.options.modulesDir,
...require.resolve.paths(name) || [],
]
const info = await getPackageInfo(name, { paths: modulePaths })
if (!info)
return
current = info.packageJson.version
Expand Down

0 comments on commit 04269d0

Please sign in to comment.