Skip to content

Commit d185c9b

Browse files
committed
fix: use @npmcli/package-json to parse local package
1 parent 04d6910 commit d185c9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

workspaces/config/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,11 @@ class Config {
669669
}
670670

671671
if (this.localPrefix && hasPackageJson) {
672-
const rpj = require('read-package-json-fast')
672+
const pkgJson = require('@npmcli/package-json')
673673
// if we already set localPrefix but this dir has a package.json
674674
// then we need to see if `p` is a workspace root by reading its package.json
675675
// however, if reading it fails then we should just move on
676-
const pkg = await rpj(resolve(p, 'package.json')).catch(() => false)
676+
const { content: pkg } = await pkgJson.normalize(p).catch(() => ({ content: {} }))
677677
if (!pkg) {
678678
continue
679679
}

0 commit comments

Comments
 (0)