Skip to content

Commit f5fbf38

Browse files
committed
fix: attach path to json parse error
With a TODO to move this to the right place eventually
1 parent b7882c3 commit f5fbf38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

workspaces/arborist/lib/arborist/load-actual.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ module.exports = cls => class ActualLoader extends cls {
285285
params.overrides = root.overrides.getNodeRule({ name: pkg.name, version: pkg.version })
286286
}
287287
} catch (err) {
288+
if (err.code === 'EJSONPARSE') {
289+
// TODO @npmcli/package-json should be doing this
290+
err.path = join(real, 'package.json')
291+
}
288292
params.error = err
289293
}
290294

0 commit comments

Comments
 (0)