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

quasar upgrade -i fails with ERESOLVE unable to resolve dependency tree #13786

Closed
khteh opened this issue Jun 25, 2022 · 5 comments
Closed

quasar upgrade -i fails with ERESOLVE unable to resolve dependency tree #13786

khteh opened this issue Jun 25, 2022 · 5 comments
Labels
area/cli bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-webpack kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@khteh
Copy link

khteh commented Jun 25, 2022

What 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: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR!   peer vue@"^2.6.14 || ^3.2.0" from [email protected]
npm ERR!   node_modules/pinia
npm ERR!     peerOptional pinia@"^2.0.0" from @quasar/[email protected]
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/[email protected]
npm ERR!   node_modules/@vue/composition-api
npm ERR!     peerOptional @vue/composition-api@"^1.4.0" from [email protected]
npm ERR!     node_modules/pinia
npm ERR!       peerOptional pinia@"^2.0.0" from @quasar/[email protected]
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/[email protected]
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_
@khteh khteh added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Jun 25, 2022
@github-actions github-actions bot added area/cli bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-webpack labels Jun 25, 2022
@yusufkandemir
Copy link
Member

yusufkandemir commented Jun 26, 2022

vue and vue-router is missing in your project. If you run quasar dev, it should detect and install them automatically. Otherwise, you can install them yourself(yarn add vue vue-router).

@khteh
Copy link
Author

khteh commented Jun 26, 2022

vue and vue-router is missing in your project. If you run quasar dev, it should detect and install them automatically. Otherwise, you can install them yourself(yarn add vue vue-router).

$ q dev


 .d88888b.
d88P" "Y88b
888     888
888     888 888  888  8888b.  .d8888b   8888b.  888d888
888     888 888  888     "88b 88K          "88b 888P"
888 Y8b 888 888  888 .d888888 "Y8888b. .d888888 888
Y88b.Y8b88P Y88b 888 888  888      X88 888  888 888
 "Y888888"   "Y88888 "Y888888  88888P' "Y888888 888
       Y8b

  Running @quasar/cli v1.3.2

  Example usage
    $ quasar <command> <options>

  Help for a command
    $ quasar <command> --help
    $ quasar <command> -h

  Options
    --version, -v Print Quasar CLI version

  Commands
    create    Create a project folder
    info      Display info about your machine
                   (and your App if in a project folder)
    upgrade   Check (and optionally) upgrade Quasar packages
                   from a Quasar project folder
    serve     Create an ad-hoc server on App's distributables
    help, -h  Displays this message

  --------------
  => IMPORTANT !
  => Trigger this inside of a Quasar project (and npm/yarn install) for more commands.
  --------------


 Error Unknown command "dev"

No, it doesn't install them automatically as you said.

$ n i vue --save
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/vue
npm ERR!   vue@"*" from the root project
npm ERR!   peer vue@"^2.6.14 || ^3.2.0" from [email protected]
npm ERR!   node_modules/pinia
npm ERR!     peerOptional pinia@"^2.0.0" from @quasar/[email protected]
npm ERR!     node_modules/@quasar/app-webpack
npm ERR!       dev @quasar/app-webpack@"^3.5.4" from the root project
npm ERR!   1 more (@vue/composition-api)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^3.2.29" from @quasar/[email protected]
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-26T09_29_42_830Z-debug-0.log
$ n i vue-router --save
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/vue
npm ERR!   peer vue@"^2.6.14 || ^3.2.0" from [email protected]
npm ERR!   node_modules/pinia
npm ERR!     peerOptional pinia@"^2.0.0" from @quasar/[email protected]
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/[email protected]
npm ERR!   node_modules/@vue/composition-api
npm ERR!     peerOptional @vue/composition-api@"^1.4.0" from [email protected]
npm ERR!     node_modules/pinia
npm ERR!       peerOptional pinia@"^2.0.0" from @quasar/[email protected]
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/[email protected]
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-26T09_30_14_920Z-debug-0.log

And no, it doesn't successfully install the vue and vue-router as you said either.

@khteh
Copy link
Author

khteh commented Jun 26, 2022

/open
/reopen

@yusufkandemir
Copy link
Member

Error Unknown command "dev"

The error is happening because NPM broke node_modules in the failed quasar upgrade -i attempt. Re-run npm i to restore. Then install the dependencies again.

I can successfully install the dependencies in the reproduction project you provided.

image

quasar dev doesn't install the deps automatically, because you already have vue in package-lock.json, NPM probably installed it before somehow. If you remove your package-lock.json, then try installing the deps, and you will see the unable 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 and node_modules, then add the following to your package.json > dependencies manually, then run npm i.

  "vue": "^3.0.0",
  "vue-router": "^4.0.0"

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.

@khteh
Copy link
Author

khteh commented Jun 26, 2022

That works. Thank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-webpack kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants