Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

[BUG] (EDITED: see Companion-issues) 'npm update' causes arborist to throw on unmet peer-dep in v7-beta #114

Closed
KilianKilmister opened this issue Aug 16, 2020 · 1 comment

Comments

@KilianKilmister
Copy link

KilianKilmister commented Aug 16, 2020

What / Why

When using npm updatein a workspace with version mismached peer-deps

How

Current Behavior

EDIT: it's much more about the reason for the error not trickeling down properly, as only the message " unable to resolve dependency tree" is included in the output
Companion issue in npm/cli
RRFC about current peer-dep behaviour

There's really not much to say about it. Semver won't accept the dev-version no matter what

Error object

{
code: 'ERESOLVE'
current: {pkgid: 'typescript@4.0.0-dev.20200803', location: 'node_modules/typescript'}
location: '/Users/kilianhefti/dev/cmd-repo/node_modules/ts-node'
message: 'unable to resolve dependency tree'
package: 'typescript'
requiredBy: 'ts-node@8.10.2'
spec: '>=2.7'
stack: 'Error: unable to resolve dependency tree // NOTE: the eval is not part of the stack of course
    at eval (eval at <anonymous> (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:771:7), <anonymous>:1:15)
    at Arborist.[placeDep] (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:771:7)
    at /Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:588:4…modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:588:8)
    at async Arborist.buildIdealTree (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:160:7)
    at async Promise.all (index 1)
    at async Arborist.reify (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:126:5)
    at async update (/Users/kilianhefti/.npm-packages/lib/node_modules/npm/lib/update.js:34:3)'
type: 'peer'
}
@KilianKilmister KilianKilmister changed the title [BUG] 'npm update' causes arborist to throw on unmet peer-dep in v7-beta [BUG] (EDITED: see Companion-issues) 'npm update' causes arborist to throw on unmet peer-dep in v7-beta Aug 17, 2020
@isaacs
Copy link
Contributor

isaacs commented Aug 19, 2020

Yeah, that's because the peer deps can't be resolved. This error is working as intended, you can npm update --legacy-peer-deps to suppress peer dep resolution.

We do need to report ERESOLVE errors better in the CLI, and Arborist needs to provide a more useful backtrace explanation object in order to do that optimally. It's second on my todo list after #113, which is a more severe failure :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants