davellanedam / vue-skeleton-mvp

VueJs, Vuetify, Vue Router and Vuex skeleton MVP written on JavaScript using async/await built to work with API REST skeleton: https://github.com/davellanedam/node-express-mongodb-jwt-rest-api-skeleton
MIT License
513 stars 152 forks source link

`npm update` fails #255

Closed niclash closed 3 years ago

niclash commented 3 years ago

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 commented 3 years ago

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

niclash commented 3 years ago

version 12.20.1

niclash commented 3 years ago
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 commented 3 years ago
image
niclash commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.