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
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I run yarn audit --json multiple root objects are being returned which makes parsing quite difficult as the JSON is invalid.
If the current behavior is a bug, please provide the steps to reproduce.
Running something like:
SyntaxError: Unexpected token { in JSON at position 1480
at JSON.parse (<anonymous>)
at exec (/Users/user/web/project/index.js:62:16)
at ChildProcess.exithandler (child_process.js:298:5)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:598:12)
✨ Done in 5.95s.
What is the expected behavior? npm audit --json returns a valid json object for parsing. I would expect the same for yarn audit --json
Please mention your node.js, yarn and operating system version.
node: v10.6.0
yarn: 1.12.3
OS: MacOS Mojave 10.14.1
The text was updated successfully, but these errors were encountered:
The output is in json-lines format, and has been since the --json flag was first introduced in yarn. All the yarn commands output in this same format, not just audit.
There is some discussion in #5021
The output is in json-lines format, and has been since the --json flag was first introduced in yarn. All the yarn commands output in this same format, not just audit.
There is some discussion in #5021
Than, based on the link you're referring to, it's neither json, nor json-lines, since the output is wrapped into extra pair of curly braces, which, I believe, causes the above error.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I run
yarn audit --json
multiple root objects are being returned which makes parsing quite difficult as the JSON is invalid.If the current behavior is a bug, please provide the steps to reproduce.
Running something like:
Will return:
What is the expected behavior?
npm audit --json
returns a valid json object for parsing. I would expect the same foryarn audit --json
Please mention your node.js, yarn and operating system version.
node: v10.6.0
yarn: 1.12.3
OS: MacOS Mojave 10.14.1
The text was updated successfully, but these errors were encountered: