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

npm error when installing pinia #853

Closed
matthiashermsen opened this issue Nov 29, 2021 · 44 comments · Fixed by #1901
Closed

npm error when installing pinia #853

matthiashermsen opened this issue Nov 29, 2021 · 44 comments · Fixed by #1901
Labels
contribution welcome help wanted Any external help on this topic is welcomed upstream The fix depends on a dependency

Comments

@matthiashermsen
Copy link

This issue might be a duplicate of #724

I'm trying to install Pinia via npm but get a

ERESOLVE unable to resolve dependency tree

error.

Reproduction

  • OS: Win10 and Pop!_OS 21.04
  • Node version: v16.13.0
  • npm version: 8.1.0
  • Vue CLI version: 4.5.15
  • Vue version: 3.0.0

The project setup on Win10:

image

I created a temporary repository showing the inial commit after creating the project with the Vue CLI

https://github.com/matthiashermsen/temp-pinia

Steps to reproduce the behavior

  1. Clone the repository
  2. Run npm install
  3. Run npm install pinia
  4. You should get an error

Expected behavior

It should install the package without errors.

Actual behavior

This is the terminal error on Win10

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: repo@0.0.0-development
npm ERR! Found: vue@3.2.22
npm ERR! node_modules/vue
npm ERR!   peerOptional vue@"^2 || ^3.0.0-0" from @vue/babel-preset-app@4.5.15
npm ERR!   node_modules/@vue/babel-preset-app
npm ERR!     @vue/babel-preset-app@"^4.5.15" from @vue/cli-plugin-babel@4.5.15
npm ERR!     node_modules/@vue/cli-plugin-babel
npm ERR!       dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!   peer vue@"3.2.22" from @vue/server-renderer@3.2.22
npm ERR!   node_modules/@vue/server-renderer
npm ERR!     @vue/server-renderer@"3.2.22" from vue@3.2.22
npm ERR!   5 more (@vue/test-utils, primevue, vue-jest, vue-router, the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! pinia@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@3.2.23
npm ERR! node_modules/vue
npm ERR!   peer vue@">= 2.5 < 3" from @vue/composition-api@1.4.0
npm ERR!   node_modules/@vue/composition-api
npm ERR!     peerOptional @vue/composition-api@"^1.4.0" from pinia@2.0.4
npm ERR!     node_modules/pinia
npm ERR!       pinia@"*" 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 C:\Users\me\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\me\AppData\Local\npm-cache\_logs\2021-11-26T09_39_36_434Z-debug.log

and this is the npm log file

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install',
0 verbose cli   'pinia'
0 verbose cli ]
1 info using npm@8.1.0
2 info using node@v16.13.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\me\Repositories\repo\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\me\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\me\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 11ms
19 timing npm:load:configload Completed in 11ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 2ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 1ms
26 timing npm:load Completed in 18ms
27 timing arborist:ctor Completed in 1ms
28 timing idealTree:init Completed in 1304ms
29 timing idealTree:userRequests Completed in 4ms
30 silly idealTree buildDeps
31 silly fetch manifest pinia@*
32 timing arborist:ctor Completed in 0ms
33 http fetch GET 200 https://registry.npmjs.org/pinia 1424ms (cache revalidated)
34 silly fetch manifest @vue/composition-api@^1.4.0
35 http fetch GET 200 https://registry.npmjs.org/@vue%2fcomposition-api 87ms (cache revalidated)
36 silly fetch manifest vue@^3.0.0
37 http fetch GET 200 https://registry.npmjs.org/vue 55ms (cache revalidated)
38 silly fetch manifest vue@>= 2.5 < 3
39 silly fetch manifest typescript@~4.1.5
40 http fetch GET 200 https://registry.npmjs.org/typescript 60ms (cache revalidated)
41 silly fetch manifest typescript@^4.4.4
42 timing idealTree Completed in 2998ms
43 timing command:install Completed in 3012ms
44 verbose stack Error: could not resolve
44 verbose stack     at PlaceDep.failPeerConflict (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:544:25)
44 verbose stack     at PlaceDep.place (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:197:21)
44 verbose stack     at new PlaceDep (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:71:10)
44 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:944:31
44 verbose stack     at Array.map (<anonymous>)
44 verbose stack     at Arborist.[buildDepStep] (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:944:8)
44 verbose stack     at async Arborist.buildIdealTree (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:216:7)
44 verbose stack     at async Promise.all (index 1)
44 verbose stack     at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:149:5)
44 verbose stack     at async Install.install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:170:5)
45 verbose cwd C:\Users\me\Repositories\repo
46 verbose Windows_NT 10.0.19042
47 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "pinia"
48 verbose node v16.13.0
49 verbose npm  v8.1.0
50 error code ERESOLVE
51 error ERESOLVE could not resolve
52 error
53 error While resolving: [1mrepo[22m@[1m0.0.0-development[22m
53 error Found: [1mvue[22m@[1m3.2.22[22m[2m[22m
53 error [2mnode_modules/vue[22m
53 error   peerOptional [1mvue[22m@"[1m^2 || ^3.0.0-0[22m" from [1m@vue/babel-preset-app[22m@[1m4.5.15[22m[2m[22m
53 error   [2mnode_modules/@vue/babel-preset-app[22m
53 error     [1m@vue/babel-preset-app[22m@"[1m^4.5.15[22m" from [1m@vue/cli-plugin-babel[22m@[1m4.5.15[22m[2m[22m
53 error     [2mnode_modules/@vue/cli-plugin-babel[22m
53 error       [33mdev[39m [1m@vue/cli-plugin-babel[22m@"[1m~4.5.0[22m" from the root project
53 error   [35mpeer[39m [1mvue[22m@"[1m3.2.22[22m" from [1m@vue/server-renderer[22m@[1m3.2.22[22m[2m[22m
53 error   [2mnode_modules/@vue/server-renderer[22m
53 error     [1m@vue/server-renderer[22m@"[1m3.2.22[22m" from [1mvue[22m@[1m3.2.22[22m
53 error   5 more (@vue/test-utils, primevue, vue-jest, vue-router, the root project)
53 error
53 error Could not resolve dependency:
53 error [1mpinia[22m@"[1m*[22m" from the root project
53 error
53 error Conflicting peer dependency: [1mvue[22m@[1m3.2.23[22m[2m[22m
53 error [2mnode_modules/vue[22m
53 error   [35mpeer[39m [1mvue[22m@"[1m>= 2.5 < 3[22m" from [1m@vue/composition-api[22m@[1m1.4.0[22m[2m[22m
53 error   [2mnode_modules/@vue/composition-api[22m
53 error     peerOptional [1m@vue/composition-api[22m@"[1m^1.4.0[22m" from [1mpinia[22m@[1m2.0.4[22m[2m[22m
53 error     [2mnode_modules/pinia[22m
53 error       [1mpinia[22m@"[1m*[22m" from the root project
53 error
53 error Fix the upstream dependency conflict, or retry
53 error this command with --force, or --legacy-peer-deps
53 error to accept an incorrect (and potentially broken) dependency resolution.
53 error
53 error See C:\Users\me\AppData\Local\npm-cache\eresolve-report.txt for a full report.
54 verbose exit 1

Additional information

Based on #724 (comment) I think it points to the correct url ( https://registry.npmjs.org/pinia )

Based on #727 (comment) I think there is no @vue/compositon-api package installed. I tested npm remove @vue/composition-api too.

@posva posva added contribution welcome help wanted Any external help on this topic is welcomed labels Dec 1, 2021
@posva
Copy link
Member

posva commented Dec 1, 2021

Using --legacy-peer-deps, npm 7, yarn, or pnpm should work as a workaround. I found npm/cli#4104 which could be related. Any help on this is appreciated!

Edit: Apparently, this is okay from npm perspective and they expect users to use overrides to pin the vue version

@matthiashermsen
Copy link
Author

@posva I used npm install -g npm@7 to downgrade my npm version to v7.24.2 but that didn't help.

Running npm install pinia --legacy-peer-deps works but that could be dangerous in the future, no?

@LinusBorg
Copy link
Member

LinusBorg commented Dec 1, 2021

Well, the hope would be that this gets fixed in npm in the not too distant future ...

@posva posva added the upstream The fix depends on a dependency label Dec 13, 2021
@awacode21
Copy link

Same on Mac (MacBook Pro (13-inch, M1, 2020), macOS Monterey)

awacode@awacode-MBP13 nuxt3-bivignano % npm install pinia @pinia/nuxt
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vue@3.2.26
npm ERR! node_modules/vue
npm ERR!   peer vue@"3.2.26" from @nuxt/vite-builder@3.0.0-27338323.1e98259
npm ERR!   node_modules/@nuxt/vite-builder
npm ERR!     @nuxt/vite-builder@"npm:@nuxt/vite-builder-edge@3.0.0-27338323.1e98259" from nuxt3@3.0.0-27338323.1e98259
npm ERR!     node_modules/nuxt3
npm ERR!       dev nuxt3@"^3.0.0-27338323.1e98259" from the root project
npm ERR!   peer vue@"3.2.26" from @nuxt/webpack-builder@3.0.0-27338323.1e98259
npm ERR!   node_modules/@nuxt/webpack-builder
npm ERR!     @nuxt/webpack-builder@"npm:@nuxt/webpack-builder-edge@3.0.0-27338323.1e98259" from nuxt3@3.0.0-27338323.1e98259
npm ERR!     node_modules/nuxt3
npm ERR!       dev nuxt3@"^3.0.0-27338323.1e98259" from the root project
npm ERR!   5 more (@vitejs/plugin-vue, @vue/server-renderer, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @pinia/nuxt@"*" 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.4.3
npm ERR!   node_modules/@vue/composition-api
npm ERR!     peerOptional @vue/composition-api@"^1.4.0" from pinia@2.0.9
npm ERR!     node_modules/pinia
npm ERR!       pinia@"*" from the root project
npm ERR!       1 more (@pinia/nuxt)
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 /Users/awacode/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/awacode/.npm/_logs/2022-01-10T00_12_02_442Z-debug.log

@dakt

This comment has been minimized.

@matthiashermsen
Copy link
Author

Using the latest node, npm and Vue cli version doesn't solve the issue.

But when moving to Vite by setting up the project via npm init vue@latest solved the issue for me :)

@basickarl

This comment was marked as spam.

@KeentGG
Copy link

KeentGG commented Feb 28, 2022

getting the same error on a fresh nuxt 3 installation. tried all the workarounds above to no avail

@bartenra
Copy link

bartenra commented Mar 1, 2022

npm install --legacy-peer-deps pinia

seems to work now.

@cifuentesmx
Copy link

cifuentesmx commented Mar 2, 2022

As @andrei-gheorghiu commented using yarn install && yarn add pinia works using node v16.14.0 and yarn v1.22.17

@michtio
Copy link

michtio commented May 17, 2022

Same issue here:

Attaching to the-hub-nuxt-1
the-hub-nuxt-1  | npm ERR! code ERESOLVE
the-hub-nuxt-1  | npm ERR! ERESOLVE could not resolve
the-hub-nuxt-1  | npm ERR! 
the-hub-nuxt-1  | npm ERR! While resolving: the-hub@1.0.0-alpha.1
the-hub-nuxt-1  | npm ERR! Found: vue@3.2.33
the-hub-nuxt-1  | npm ERR! node_modules/vue
the-hub-nuxt-1  | npm ERR!   peer vue@"^3.2.0" from @headlessui/vue@1.6.1
the-hub-nuxt-1  | npm ERR!   node_modules/@headlessui/vue
the-hub-nuxt-1  | npm ERR!     @headlessui/vue@"^1.6.0" from the root project
the-hub-nuxt-1  | npm ERR!   peer vue@">= 3" from @heroicons/vue@1.0.6
the-hub-nuxt-1  | npm ERR!   node_modules/@heroicons/vue
the-hub-nuxt-1  | npm ERR!     @heroicons/vue@"^1.0.6" from the root project
the-hub-nuxt-1  | npm ERR!   1 more (nuxt)
the-hub-nuxt-1  | npm ERR! 
the-hub-nuxt-1  | npm ERR! Could not resolve dependency:
the-hub-nuxt-1  | npm ERR! pinia@"^2.0.14" from the root project
the-hub-nuxt-1  | npm ERR! 
the-hub-nuxt-1  | npm ERR! Conflicting peer dependency: vue@2.6.14
the-hub-nuxt-1  | npm ERR! node_modules/vue
the-hub-nuxt-1  | npm ERR!   peer vue@">= 2.5 < 3" from @vue/composition-api@1.6.1
the-hub-nuxt-1  | npm ERR!   node_modules/@vue/composition-api
the-hub-nuxt-1  | npm ERR!     peerOptional @vue/composition-api@"^1.4.0" from pinia@2.0.14
the-hub-nuxt-1  | npm ERR!     node_modules/pinia
the-hub-nuxt-1  | npm ERR!       pinia@"^2.0.14" from the root project
the-hub-nuxt-1  | npm ERR! 
the-hub-nuxt-1  | npm ERR! Fix the upstream dependency conflict, or retry
the-hub-nuxt-1  | npm ERR! this command with --force, or --legacy-peer-deps
the-hub-nuxt-1  | npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
the-hub-nuxt-1  | npm ERR! 
the-hub-nuxt-1  | npm ERR! See /root/.npm/eresolve-report.txt for a full report.
the-hub-nuxt-1  | 
the-hub-nuxt-1  | npm ERR! A complete log of this run can be found in:
the-hub-nuxt-1  | npm ERR!     /root/.npm/_logs/2022-05-17T08_29_57_654Z-debug-0.log
the-hub-nuxt-1 exited with code 1

Imo this asks for a package for vue3 only.

Pinia 2.0 for Vue 2
Pinia 3.0 for Vue 3

Makes more sense to avoid these issues imo!

@michtio
Copy link

michtio commented May 17, 2022

As an update tho if you specifically mention that you want to use Vue 3 in your dependencies, it all installs without issues:

"dependencies": {
    "@headlessui/vue": "^1.6.0",
    "@heroicons/vue": "^1.0.6",
    "@nuxt/kit": "npm:@nuxt/kit-edge@latest",
    "@nuxtjs/axios": "^5.13.6",
    "@pinia/nuxt": "^0.1.9",
    "nuxt-graphql-client": "^0.0.30",
    "pinia": "^2.0.14",
    "vue": "^3.2.33"
  },

@dosstx
Copy link
Contributor

dosstx commented Jun 1, 2022

If using nuxt3, we still need to install Vue3 in order to get Pinia to successfully install?

@YuuuFen

This comment was marked as spam.

xicri added a commit to xicri/genshin-dictionary that referenced this issue Jul 23, 2022
xicri added a commit to xicri/genshin-dictionary that referenced this issue Jul 23, 2022
xicri added a commit to xicri/genshin-dictionary that referenced this issue Jul 23, 2022
@Maximus1000
Copy link

Confirming had the same issue with nuxt@3.0.0-rc-6 with only tailwind and headless as dep. Install of pinia failed due to vue@2.6.14 peer dependency.
Solution was to install vue@latest as dependency and on re-running pinia install, success. Prefer this method rather than to use force flag or otherwise hardcode peer dependencies override. Thx @michtio .

@costingeana
Copy link

costingeana commented Aug 2, 2022

Hello,
My initial package.json looked like:
"dependencies": { "vue": "3", "pinia": "2" }
and I got the same error.

I applied the following changes (as inidcated by @posva earlier in the discussion):

  • npm version >= 8
  • in package.json pin the vue version :
    "overrides": { "vue": "3" },
    and it simply works.

@posva posva changed the title Unable to install the package npm error when installing pinia Aug 10, 2022
@maxdzin
Copy link

maxdzin commented Nov 27, 2022

So, this "works like charm" solution stopped working for me now with pinia 2.0.27. But just a slight modification helped:

"overrides": { 
    "vue": "latest"
}

Same for me.

@Squadz
Copy link

Squadz commented Nov 30, 2022

I confirm, this work pretty well with pinia 2.0.27.
"overrides": { "vue": "latest" }

@rhengles
Copy link

rhengles commented Dec 6, 2022

I tried this overrides solution and it changed absolutely nothing for me.

All I did was this:

// from https://github.com/antfu/vitesse-nuxt3
npx degit antfu/vitesse-nuxt3 my-nuxt3-app
cd my-nuxt3-app
pnpm i
pnpm dev // Error!
rm -rf node_modules pnpm-lock.yaml
// add "overrides" to package.json
pnpm i
pnpm dev // Still error!

// Error:
// Cannot find package '@vue/composition-api' imported from /home/user/my-nuxt3-app/node_modules/.pnpm/vue-demi@0.13.11/node_modules/vue-demi/lib/index.mjs

nuxt/nuxt#14789

EDIT: The error below happens even without installing pinia, so I guess it's 100% fault of Nuxt itself.

I even tried downloading this example and installing locally... I had two errors, the first because it didn't find the package vue, and the second because it didn't find the package vue-router. After I installed these, I got the following error:

500
Cannot read properties of undefined (reading 'modules')

at _sfc_main.setup (./node_modules/.pnpm/nuxt@3.0.0/node_modules/nuxt/dist/app/components/nuxt-root.vue:67:16)
at callWithErrorHandling (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
at setupStatefulComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7176:29)
at setupComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.45/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7131:11)
at renderComponentVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.45_vue@3.2.45/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)
at renderToString (./node_modules/.pnpm/@vue+server-renderer@3.2.45_vue@3.2.45/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:450:26)
at Object.renderToString$1 [as renderToString] (./.nuxt/dev/index.mjs:585:24)
at Object.renderToString (./node_modules/.pnpm/vue-bundle-renderer@1.0.0/node_modules/vue-bundle-renderer/dist/runtime.mjs:173:40)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ./.nuxt/dev/index.mjs:645:21

This is what's inside nuxt-root.vue file at line 16 (it has 36 lines in total)

 8 | <script setup>
 9 | import { defineAsyncComponent, onErrorCaptured, provide } from 'vue'
10 | import { callWithNuxt, isNuxtError, showError, useError, useRoute, useNuxtApp } from '#app'
11 | import AppComponent from '#build/app-component.mjs'
12 | 
13 | const ErrorComponent = defineAsyncComponent(() => import('#build/error-component.mjs').then(r => r.default || r))
14 | 
15 | const nuxtApp = useNuxtApp()
16 | const onResolve = nuxtApp.deferHydration()
17 | 
18 | // Inject default route (outside of pages) as active route
19 | provide('_route', useRoute())

@xwellingtonx
Copy link

I can confirm that "overrides": { "vue": "latest" } works for pinia 2.0.28

@Cyclodex
Copy link

Cyclodex commented Dec 29, 2022

I followed the instructions, and had the same issue, npm did not want to install pinia because of the version conflict.
Maybe it would make sense to document this on the following page

https://pinia.vuejs.org/ssr/nuxt.html#installation

It's just frustrating when you follow instructions and it doesn't work as expected :(

@AloisSeckar
Copy link
Contributor

The error mentioned, that you can try the command with the option --legacy-peer-deps or --force and indeed, the installation works when I run: npm install -D pinia --legacy-peer-deps, so this would be an other solution for now, next to the "overrides" option in package.json

yes, this works as well, but it makes your app less portable - you need to tell everyone to use --legacy-peer-deps when running their local npm install, you need to include it in CI/CD pipelines...

after including overrides in package.json you don't need to worry about this, so from my point of view, it is much better fix

or it doesn't work for you now? something may change as new versions of npm packages come out...

@Cyclodex
Copy link

@AloisSeckar Sorry, I was a bit too fast with my comment and had to read the whole story above first... :/

It works with the override, but I think for new users, coming with Nuxt 3 for example and add Pinia, we should place a comment in the documentation to help them going forward, and not search for this issue here... What do you think?

AloisSeckar added a commit to AloisSeckar/pinia that referenced this issue Dec 29, 2022
Because people keep running into vuejs#853 I'd suggest to include the troubleshoting directly inside the docs
@AloisSeckar
Copy link
Contributor

@AloisSeckar Sorry, I was a bit too fast with my comment and had to read the whole story above first... :/

It works with the override, but I think for new users, coming with Nuxt 3 for example and add Pinia, we should place a comment in the documentation to help them going forward, and not search for this issue here... What do you think?

Not bad idea at all. Since pinia docs allow quick change suggestions via GitHub, you inspired me to propose one: #1901

@Cyclodex
Copy link

@AloisSeckar cool thanks!

posva pushed a commit that referenced this issue Jan 6, 2023
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
Close #853
xicri added a commit to xicri/genshin-dictionary that referenced this issue Feb 19, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
@oscarhumbertomr
Copy link

I just delete package-lock.json and then ran
npm install pinia

xicri added a commit to xicri/genshin-dictionary that referenced this issue Feb 25, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue Mar 13, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue Apr 26, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue May 12, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue May 15, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue May 15, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue May 15, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
xicri added a commit to xicri/genshin-dictionary that referenced this issue May 31, 2023
--legacy-peer-deps was required as a workaround for vuejs/pinia#853, but it is now resolved on my end.
@maxallaneccles
Copy link

"overrides": {
"vue": "latest"
}

add this to package.json

@awacode21
Copy link

"overrides": { "vue": "latest" }

add this to package.json

That solves the issue and is also documented on pinia: https://pinia.vuejs.org/ssr/nuxt.html as a "Tip"

arthur-king-excalibur added a commit to arthur-king-excalibur/vu-pinia that referenced this issue Dec 24, 2023
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
Close vuejs/pinia#853
@C17AN
Copy link

C17AN commented Jan 1, 2024

// Error!
npm ERR! code EOVERRIDE
npm ERR! Override for vue@^3.2.40 conflicts with direct dependency

npm ERR! A complete log of this run can be found in:
// package.json
  "overrides": {
    "vue": "latest"
  }

Hi, I'm getting above error with setting overrides property on package.json.
Is there any ways to install pinia without using --legacy-peer-deps flag?

@AloisSeckar
Copy link
Contributor

npm ERR! Override for vue@^3.2.40 conflicts with direct dependency

I believe this is because some other dependency pins vue to certain lower version.

You can try npm ls --all to see which one is causing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome help wanted Any external help on this topic is welcomed upstream The fix depends on a dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.