Skip to content

[BUG] 'npm update' results in unclear error on peer-dep mismatch #1681

Description

@KilianKilmister

Companion issue posted in arborist

Current Behavior:

npm update results in arborist thowing an Error on mismatched peer-dep

the resulting error message doesn't point at what caused the error:

npm ERR! code ERESOLVE
npm ERR! unable to resolve dependency tree

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kilianhefti/.npm/_logs/2020-08-16T01_03_09_094Z-debug.log
Waiting for the debugger to disconnect...

Expected Behavior:

Concise error message (and a way of strong-arming a match as no dev-/preview/-whatever-version will ever be compatible)RRFC about current peer-dep behaviour

Steps To Reproduce:

have unmatched peer-dep (eg. ts-node and typescript@4.0.0-dev)

Environment:

final log entries: dist, node-v and npm-v are highlited

1001 timing command:update Completed in 20505ms
1002 verbose type peer
1003 verbose stack Error: unable to resolve dependency tree
1003 verbose stack at Arborist.[placeDep] (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:771:27)
1003 verbose stack at /Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:588:46
1003 verbose stack at Array.map ()
1003 verbose stack at Arborist.[buildDepStep] (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:588:8)
1003 verbose stack at async Arborist.buildIdealTree (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:160:7)
1003 verbose stack at async Promise.all (index 1)
1003 verbose stack at async Arborist.reify (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:126:5)
1003 verbose stack at async update (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/lib/update.js:34:3)
1004 verbose cwd /Users/kilianhefti/dev/cmd-repo
1005 verbose Darwin 19.6.0
1006 verbose argv "/usr/local/bin/node" "/Users/kilianhefti/.npm-packages/bin/npm" "update"
1007 verbose node v14.8.0
1008 verbose npm v7.0.0-beta.4
1009 error code ERESOLVE
1010 error unable to resolve dependency tree
1011 verbose exit [ 1, true ]

Note

I will file a propper RFC about strong-arming the peer-dep stuff (Link to come)
RRFC about current peer-dep behaviour
But having had to debug dependency resolution to discover the issue, I have to say, there is some real nice code in the npm-repos. well commented, clean, smart. v7 is looking good.
And i've been experimenting with npm-workspaces: the linking works like a charm and everything looks really clean. there should be some beta documentation on them tho. i only descovered that it was working while i debugged Arborists tree-building.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions