You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @hope-church-tritech, thanks for reporting this. I think it could be the JSON output from the npm audit result being invalid/incomplete.
May I know what would you see if you put a console.log('jsonBuffer', jsonBuffer); in your /node_modules/better-npm-audit/index.js around line 35, and run it again?
// Once the stdout has completed, process the outputif(audit.stderr){audit.stderr.on('close',function(){console.log('jsonBuffer',jsonBuffer);// Analyze the npm audit response
The particular issue I was having was that the stderr & stdout of npm audit were both blank, causing the aforementioned output. This seems misleading since the .nsprc file was not where the invalid json was originating from, which was the impetus for writing up this issue.
I've already found and fixed what was causing my specific problem, which is that an ENOENT error occurs when trying to call npm audit on Ubuntu 20.04 when node is installed via snap instead of apt.
When an error occurs parsing the json from
npm audit
result while runningbetter-npm-audit audit
, the error message is:regardless of whether there is a .nsprc file.
The offending line is:
better-npm-audit/src/utils/common.ts
Line 23 in 0b7259f
The text was updated successfully, but these errors were encountered: