Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] unable to resolve dependency tree #3308

Closed
1 task done
Janpot opened this issue May 26, 2021 · 4 comments
Closed
1 task done

[BUG] unable to resolve dependency tree #3308

Janpot opened this issue May 26, 2021 · 4 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@Janpot
Copy link

Janpot commented May 26, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

"unable to resolve dependency tree" errors when trying to install a dependency, even though the semver range is satisfied.

Expected Behavior

Dependencies can be installed without any error

Steps To Reproduce

  1. go to an empty folder
  2. run npm init --yes && npm add next next-rpc
  3. observe error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: next@undefined
npm ERR! node_modules/next
npm ERR!   next@"*" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@">10" from [email protected]
npm ERR! node_modules/next-rpc
npm ERR!   next-rpc@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/me/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2021-05-26T13_42_24_577Z-debug.log

This works with npm@6.

There's also this strange line

npm ERR! Found: next@undefined

Running the install commands separately

npm add next
npm add next-rpc

gives:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/next
npm ERR!   next@"^10.2.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@">10" from [email protected]
npm ERR! node_modules/next-rpc
npm ERR!   next-rpc@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/me/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2021-05-26T13_49_45_158Z-debug.log

10.2.3 is supposed to satisfy >10, right?

Environment

  • OS: MacOs
  • Node: 16.2.0
  • npm: 7.13.0
@Janpot Janpot added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels May 26, 2021
@ljharb
Copy link
Contributor

ljharb commented May 26, 2021

What is npm add?

@Janpot
Copy link
Author

Janpot commented May 26, 2021

@ljharb

npm install (with no args, in package dir)
npm install [<@scope>/]<pkg>
npm install [<@scope>/]<pkg>@<tag>
npm install [<@scope>/]<pkg>@<version>
npm install [<@scope>/]<pkg>@<version range>
npm install <alias>@npm:<name>
npm install <folder>
npm install <tarball file>
npm install <tarball url>
npm install <git:// url>
npm install <github username>/<github project>

aliases: i, isntall, add
common options: [--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save]

Seems to be an alias of npm install, just like npm i and npm isntall. Not sure why I used that, must be the influence of yarn 🙂

@ljharb
Copy link
Contributor

ljharb commented May 26, 2021

oof, ok.

Either way, “> 10” excludes v10. So that requirement means you need v11+.

@Janpot
Copy link
Author

Janpot commented May 26, 2021

Ok, makes sense, thanks. Will change to >=10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants