[BUG] ERESOLVE in a workspace graph with shared dependents exits 1 with no error message
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
This is not just a request to bump a dependency for a CVE
- This is not solely a request to bump a dependency for a CVE
Current Behavior
When an ERESOLVE conflict involves a package with a dense workspace dependents graph, npm prints only A complete log of this run can be found in and exits 1. Building the full eresolve-report.txt throws RangeError: Invalid string length, and that error is never printed or written to the debug log. Below the crash threshold the report still grows exponentially (400 MB at 28 workspaces).
Expected Behavior
The normal ERESOLVE message is printed, and the full report stays a reasonable size.
Steps To Reproduce
mkdir x && cd x
echo '{"name":"root","workspaces":["w/*"],"dependencies":{"react":"17.0.2"}}' > package.json
# w0 -> react; wN -> w(N-1), w(N-2)
for i in $(seq 0 29); do
d='"react":"17.0.2"'; [ $i -gt 0 ] && d="\"w$((i-1))\":\"1.0.0\""; [ $i -gt 1 ] && d="$d,\"w$((i-2))\":\"1.0.0\""
mkdir -p w/w$i && echo "{\"name\":\"w$i\",\"version\":\"1.0.0\",\"dependencies\":{$d}}" > w/w$i/package.json
done
npm i --package-lock-only
npm i react-dom@18.3.1 --package-lock-only; echo "exit=$?"
# expected: "npm error code ERESOLVE ..." then exit=1
# actual: only "npm error A complete log of this run can be found in: ..." then exit=1
Environment
- npm: 12.0.2 and
latest(c9876d7ea) - Node.js: v24.18.0
- OS Name: macOS (Darwin 25.6.0)
- npm config: defaults (
install-strategy=linkedfails the same way)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the provided macOS shell reproduction with the listed npm and Node.js versions, starting with the package.json workspace graph and the two npm install commands. Trace where the ERESOLVE report is built and where failures are logged. Done means the reproduction prints the normal ERESOLVE message, exits 1, and the full report remains a reasonable size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100