-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
pnpm ls --json must not show errors #7514
Copy link
Copy link
Closed
Labels
Description
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
8.14.1
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
- Initialize package.json with some package;
- Create a file
.npmrccontaining invalid data; - Run
pnpm ls --json;
Example .npmrc: (it fails on Windows, at least.)
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_TOKEN}
Describe the Bug
When you run pnpm ls --json it will show a WARN on top like:
WARN Issue while reading "./.npmrc". Failed to replace env in config: ${FONTAWESOME_TOKEN}
And because of that, JSON cannot be parsed directly from stdout. Maybe this WARN should be stderr, but it goes to stdout together with JSON.
Expected Behavior
pnpm ls --json must not thrown warn, or maybe we need an option to disable it, like pnpm ls --json --warn=0.
Which Node.js version are you using?
20.10.0
Which operating systems have you used?
- macOS
- Windows
- Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
Reactions are currently unavailable