question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird npm install failure when quasar and vuex present

See original GitHub issue

Hi everyone,

I’m witnessing a very strange behavior when I try to install @vueuse/core along with the quasar component library (Vue 3 based) and Vuex (Windows 10 (21H1), Node 14.17.6, npm 7.x & 8.x tested). I created a minimal package.json just to to demonstrate the issue.

Minimal package.json

{
  "name": "vueuse-minimal",
  "version": "0.0.1",
  "dependencies": {
    "quasar": "^2.0.0",
    "vuex": "^4.0.1"
  }
}

If you put this in a folder and then run:

$ npm install
$ npm install @vueuse/core --save

You will get the error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: vueuse-minimal@0.0.1
npm ERR! Found: vue@3.2.20
npm ERR! node_modules/vue
npm ERR!   peer vue@"3.2.20" from @vue/server-renderer@3.2.20
npm ERR!   node_modules/@vue/server-renderer
npm ERR!     @vue/server-renderer@"3.2.20" from vue@3.2.20
npm ERR!   peer vue@"^3.0.2" from vuex@4.0.2
npm ERR!   node_modules/vuex
npm ERR!     vuex@"^4.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @vueuse/core@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@2.6.14
npm ERR! node_modules/vue
npm ERR!   peer vue@">= 2.5 < 3" from @vue/composition-api@1.2.4
npm ERR!   node_modules/@vue/composition-api
npm ERR!     peerOptional @vue/composition-api@"^1.1.0" from @vueuse/core@6.7.3
npm ERR!     node_modules/@vueuse/core
npm ERR!       @vueuse/core@"*" from the root project

I can’t figure out what is the missing or conflicting dependency. I thought that, since quasar ‘hides’ the vue library, this would be the problem. However, when I install just quasar and then @vueuse/core everything seems to be working fine. The problem arises only when I try to add the rest vue dependencies. My project uses a hefty amount of dependencies, but I managed to narrow it down to those. I suspect that if you use i.e. vue-i18n or another library that’s dependent on vue the problem will still arise.

The even weirdest thing, is that the same scenario with yarn works flawlessly.

One workaround I’ve found is to add the vue dependency explicitly in package.json, but I figured it could be problematic since I rely on quasar to decide the vue versions; on top of that I’m not sure if this is a good practice.

Any suggestions would be appreciated

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
momandercommented, Feb 15, 2022

It worked – thank you! I believe this issue can now be closed.

For anyone who reads this later on, here are the exact commands I ran, based on the advice from @tkat:

npm uninstall @vueuse/core
npm install quasar@2.5.5
npm install @quasar/app@3.3.3 --save-dev
npm install vue@latest
npm install @vueuse/core

The second command in that list may not be strictly necessary; I’m not sure.

1reaction
tkatcommented, Jan 27, 2022

Any updates/workarounds on this? Version is 7 now and still need to jump through hoops in order to do an npm install.

I guess this is an issue caused by vue-demi. I would appreciate some pointers in order to have some direction and try to resolve this myself.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

These dependencies were not found error in Vue.js
npm install css-loader --save-dev. If all else fails, simply remove node_modules from your project and do a fresh install: npm install.
Read more >
vue-cli-plugin-quasar - npm
Navigate to the newly created project folder and add the cli plugin. Before installing it, make sure to commit your current changes should...
Read more >
cannot find module 'vuex' or its corresponding type declarations
I re-installed every package changed many settings but it still fails to load all paths and show the error above for all files....
Read more >
Vue.js + Vuex - User Registration and Login Tutorial & Example
Install all required npm packages by running npm install from the command line in the project root folder (where the package.json is located)....
Read more >
Dependency was not found using a npm package
I wanted to use the npm nomnoml package in Quasar and got an error during build. This dependency was not found: fs in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found