-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
When package.json is accidentally left in a state that's not JSON-compliant (e.g., a comma is left after the last element in a list) and a yarn command is run against that package, the error received is Error executing command: Failed to get yarn version. While technically accurate, this isn't terribly useful and is arguably misleading, especially for less experienced developers.
To reproduce
- Create a minimal package.json file.
- Intentionally introduce an error in the file that makes it incompatible with the JSON standard.
- Save the file.
- Run
yarn install
Environment
System:
OS: macOS 26.1
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 22.21.0 - /private/var/folders/gy/11s_g2bx3cz3d13rp_j0qjzw0000gr/T/xfs-4969a028/node
Yarn: 4.12.0 - /private/var/folders/gy/11s_g2bx3cz3d13rp_j0qjzw0000gr/T/xfs-4969a028/yarn
npm: 10.9.4 - /Users/bhorvath/.nvm/versions/node/v22.21.0/bin/npmAdditional context
It's kinda ironic that, if I hadn't been able to diagnose this problem, I couldn't have filled in the Environment field by following the instructions. :)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working