`quasar upgrade -i` fails with ERESOLVE unable to resolve dependency tree
See original GitHub issueWhat happened?
Tyring to run quasar upgrade -i
fails with the following error:
$ q upgrade
Quasar CLI · Gathering information with npm...
@quasar/extras: 1.14.0 → 1.14.1
quasar: 2.7.1 → 2.7.3
@quasar/app-webpack: 3.5.3 → 3.5.4
@quasar/quasar-app-extension-testing-e2e-cypress: 4.1.2 → 4.1.4
See https://quasar.dev/start/release-notes for release notes.
Run "quasar upgrade -i" to do the actual upgrade.
khteh@khteh-p17-2i:/usr/src/khteh 2007 $ q upgrade -i
Quasar CLI · Gathering information with npm...
@quasar/extras: 1.14.0 → 1.14.1
quasar: 2.7.1 → 2.7.3
@quasar/app-webpack: 3.5.3 → 3.5.4
@quasar/quasar-app-extension-testing-e2e-cypress: 4.1.2 → 4.1.4
Quasar CLI · Running "npm install --save @quasar/extras@^1.14.1 quasar@^2.7.3"
added 2 packages, and audited 1928 packages in 12s
149 packages are looking for funding
run `npm fund` for details
8 vulnerabilities (7 moderate, 1 high)
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
Quasar CLI · Running "npm install --save-dev @quasar/app-webpack@^3.5.4 @quasar/quasar-app-extension-testing-e2e-cypress@^4.1.4"
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: khteh@1.0.0
npm ERR! Found: vue@2.6.14
npm ERR! node_modules/vue
npm ERR! peer vue@"^2.6.14 || ^3.2.0" from pinia@2.0.14
npm ERR! node_modules/pinia
npm ERR! peerOptional pinia@"^2.0.0" from @quasar/app-webpack@3.5.4
npm ERR! node_modules/@quasar/app-webpack
npm ERR! dev @quasar/app-webpack@"^3.5.4" from the root project
npm ERR! peer vue@">= 2.5 < 3" from @vue/composition-api@1.6.3
npm ERR! node_modules/@vue/composition-api
npm ERR! peerOptional @vue/composition-api@"^1.4.0" from pinia@2.0.14
npm ERR! node_modules/pinia
npm ERR! peerOptional pinia@"^2.0.0" from @quasar/app-webpack@3.5.4
npm ERR! node_modules/@quasar/app-webpack
npm ERR! dev @quasar/app-webpack@"^3.5.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^3.2.29" from @quasar/app-webpack@3.5.4
npm ERR! node_modules/@quasar/app-webpack
npm ERR! dev @quasar/app-webpack@"^3.5.4" 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/khteh/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/khteh/.npm/_logs/2022-06-25T08_12_40_740Z-debug-0.log
Quasar CLI · ⚠️ Command "npm" failed with exit code: 1
What did you expect to happen?
No error
Reproduction URL
https://github.com/khteh/quasar
How to reproduce?
quasar upgrade -i
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)
Platforms/Browsers
Chrome
Quasar info output
$ q info
Operating System Linux(5.15.0-40-generic) - linux/x64
NodeJs 18.4.0
Global packages
NPM 8.12.1
yarn 1.22.18
@quasar/cli 1.3.2
@quasar/icongenie 2.4.2
cordova Not installed
Networking
Host khteh-p17-2i
enp11s0 192.168.1.77
### Relevant log output
_No response_
### Additional context
_No response_
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ERESOLVE unable to resolve dependency tree while ...
It means you have dependency conflicts. So try running the following options one by one. 1. Remove node_modules and package-lock.json and ...
Read more >How to Fix npm ERR ERESOLVE Unable to Resolve ...
How to Fix npm ERR ERESOLVE Unable to Resolve Dependency Tree React Error in Visual Studio Code. 14K views 5 months ago. GameTrick....
Read more >[Solved] npm ERR! ERESOLVE unable to resolve ... - YouTube
Error messages: ⠸ Installing packages (npm)...npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! Could not ...
Read more >(Solved) ERESOLVE unable to resolve dependency tree while ...
Solution · 1. Remove node_modules and package-lock.json and then run. npm install. HTML. npm install · 2. Or try clearing out npm cache....
Read more >“npm ERR! ERESOLVE unable to resolve dependency tree ...
Try to run the command with --force, or --legacy-peer-deps.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The error is happening because NPM broke
node_modules
in the failedquasar upgrade -i
attempt. Re-runnpm i
to restore. Then install the dependencies again.I can successfully install the dependencies in the reproduction project you provided.
quasar dev
doesn’t install the deps automatically, because you already havevue
inpackage-lock.json
, NPM probably installed it before somehow. If you remove yourpackage-lock.json
, then try installing the deps, and you will see theunable to resolve dependency tree
errors. NPM used to be silent about missing peer deps before, so it probably somehow slipped in before or something.So, to wrap up, delete
package-lock.json
andnode_modules
, then add the following to yourpackage.json > dependencies
manually, then runnpm i
.This will also automatically “upgrade” your dependencies according to semver. So, you will not need to run
quasar upgrade -i
afterwards.To avoid such issues in the future, I would advise using Yarn instead.
vue
andvue-router
is missing in your project. If you runquasar dev
, it should detect and install them automatically. Otherwise, you can install them yourself(yarn add vue vue-router
).