Skip to content

Commit

Permalink
fix: use @npmcli/package-json to parse local package
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed May 30, 2024
1 parent 04d6910 commit d185c9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workspaces/config/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,11 @@ class Config {
}

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

0 comments on commit d185c9b

Please # to comment.