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

npm update fails #255

Closed
niclash opened this issue Feb 17, 2021 · 7 comments
Closed

npm update fails #255

niclash opened this issue Feb 17, 2021 · 7 comments

Comments

@niclash
Copy link

niclash commented Feb 17, 2021

Describe the bug
Documentation says

npm install
npm update

but npm update fails on my system with the following error message (which I think says that @vue/cli-plugin-eslint@4.5.11 depends on an earlier eslint).

niclas@d1:~/dev/pony/think4web$ npm update
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: vue-skeleton-mvp@5.0.16
npm ERR! Found: eslint@7.20.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^7.18.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.11
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR!   dev @vue/cli-plugin-eslint@"^4.5.11" 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 /home/niclas/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/niclas/.npm/_logs/2021-02-17T11_30_55_926Z-debug.log
@davellanedam
Copy link
Owner

It's working ok on my side. Please, check you are using node 12. Let me know how that goes

@niclash
Copy link
Author

niclash commented Feb 20, 2021

version 12.20.1

@niclash
Copy link
Author

niclash commented Feb 20, 2021

niclas@d1:~/dev/pony$ git clone https://github.com/davellanedam/vue-skeleton-mvp.git newtest
Cloning into 'newtest'...
remote: Enumerating objects: 3898, done.
remote: Total 3898 (delta 0), reused 0 (delta 0), pack-reused 3898
Receiving objects: 100% (3898/3898), 1.70 MiB | 3.25 MiB/s, done.
Resolving deltas: 100% (2578/2578), done.
niclas@d1:~/dev/pony$ cd newtest/
niclas@d1:~/dev/pony/newtest$ npm install

added 2341 packages, and audited 2341 packages in 18s

7 low severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
niclas@d1:~/dev/pony/newtest$ npm update
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: vue-skeleton-mvp@5.0.16
npm ERR! Found: eslint@7.20.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^7.18.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.11
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR!   dev @vue/cli-plugin-eslint@"^4.5.11" 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 /home/niclas/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/niclas/.npm/_logs/2021-02-20T16_52_33_361Z-debug.log

niclas@d1:~/dev/pony/newtest$ ls /usr/local/lib/node_modules/
@apache-royale  @fortawesome  ember-cli  jquery  meteor  npm  singlepage-js  webpack-cli  yarn

niclas@d1:~/dev/pony/newtest$ node --version
v12.20.1

@davellanedam
Copy link
Owner

image

@niclash
Copy link
Author

niclash commented Feb 21, 2021

npm update --legacy-peer-deps works.

Could it be that you have some global setting in npm that I don't have (I don't use JS as a primary language)?

@davellanedam
Copy link
Owner

I think you have npm 7 globally installed, but for node 12 you'll need 6, I guess that's the problem, each node version comes with its own npm. Install npm globally and then reinstall node 12 with default npm, this should solve it.

@niclash
Copy link
Author

niclash commented Feb 22, 2021

Indeed, I am on 7.0.13. But I am not going to attempt to downgrade.
You may not know that Linux package management handles installs, so "Install a different version" isn't really an option. At some point in the future, it is likely that something will depend on the newer version, so it will get installed and a conflict is present. OR something that requires 7.x is already on my system and will break from a downgrade. Either the new stuff won't work, or something that worked yesterday isn't working today. It is something that has caused a lot of work in the past. I hope you understand.

Since there is a work-around for the time being, I suggest that this --legacy-peer-deps is mentioned in the README.

@niclash niclash closed this as completed Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants