Weird npm install failure when quasar and vuex present
See original GitHub issueHi 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:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
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:
The second command in that list may not be strictly necessary; I’m not sure.
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.