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

Peer dependencies issue when using Pinia and nuxt3/latest (as of today) #1033

Closed
lukeocodes opened this issue Feb 5, 2022 · 2 comments
Closed

Comments

@lukeocodes
Copy link

lukeocodes commented Feb 5, 2022

Reproduction

When trying to run through a Nuxt3 getting started guide for Pinia, I came across an error with @pinia/nuxt.

Conflicting peer dependency: vue@2.6.14

Full error output

0 verbose cli [
0 verbose cli   '/Users/lukeoliff/.nvm/versions/node/v16.11.1/bin/node',
0 verbose cli   '/Users/lukeoliff/.nvm/versions/node/v16.11.1/bin/npm',
0 verbose cli   'install',
0 verbose cli   '@pinia/nuxt'
0 verbose cli ]
1 info using npm@8.0.0
2 info using node@v16.11.1
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/lukeoliff/Projects/LukeOCodes/v3/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/Users/lukeoliff/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/Users/lukeoliff/.nvm/versions/node/v16.11.1/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 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 6ms
19 timing npm:load:configload Completed in 6ms
20 timing npm:load:setTitle Completed in 13ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 1ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 0ms
26 timing npm:load Completed in 23ms
27 timing arborist:ctor Completed in 0ms
28 timing idealTree:init Completed in 308ms
29 timing idealTree:userRequests Completed in 1ms
30 silly idealTree buildDeps
31 silly fetch manifest @pinia/nuxt@*
32 timing arborist:ctor Completed in 0ms
33 http fetch GET 200 https://registry.npmjs.org/@pinia%2fnuxt 246ms (cache hit)
34 silly fetch manifest pinia@~2.0.9
35 http fetch GET 200 https://registry.npmjs.org/pinia 4ms (cache hit)
36 silly fetch manifest @vue/composition-api@^1.4.0
37 http fetch GET 200 https://registry.npmjs.org/@vue%2fcomposition-api 3ms (cache hit)
38 silly fetch manifest vue@>= 2.5 < 3
39 http fetch GET 200 https://registry.npmjs.org/vue 3ms (cache hit)
40 silly fetch manifest typescript@>=4.4.4
41 http fetch GET 200 https://registry.npmjs.org/typescript 11ms (cache hit)
42 timing idealTree Completed in 620ms
43 timing command:install Completed in 631ms
44 verbose stack Error: could not resolve
44 verbose stack     at PlaceDep.failPeerConflict (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:544:25)
44 verbose stack     at PlaceDep.place (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:197:21)
44 verbose stack     at new PlaceDep (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:71:10)
44 verbose stack     at /Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:931:31
44 verbose stack     at Array.map (<anonymous>)
44 verbose stack     at Arborist.[buildDepStep] (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:931:8)
44 verbose stack     at async Arborist.buildIdealTree (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:215:7)
44 verbose stack     at async Promise.all (index 1)
44 verbose stack     at async Arborist.reify (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:148:5)
44 verbose stack     at async Install.install (/Users/lukeoliff/.nvm/versions/node/v16.11.1/lib/node_modules/npm/lib/install.js:170:5)
45 verbose cwd /Users/lukeoliff/Projects/LukeOCodes/v3
46 verbose Darwin 20.4.0
47 verbose argv "/Users/lukeoliff/.nvm/versions/node/v16.11.1/bin/node" "/Users/lukeoliff/.nvm/versions/node/v16.11.1/bin/npm" "install" "@pinia/nuxt"
48 verbose node v16.11.1
49 verbose npm  v8.0.0
50 error code ERESOLVE
51 error ERESOLVE could not resolve
52 error
53 error While resolving: undefined@undefined
53 error Found: vue@3.2.29
53 error node_modules/vue
53 error   peer vue@"3.2.29" from @nuxt/vite-builder@3.0.0-27398533.8edd481
53 error   node_modules/@nuxt/vite-builder
53 error     @nuxt/vite-builder@"npm:@nuxt/vite-builder-edge@3.0.0-27398533.8edd481" from nuxt3@3.0.0-27398533.8edd481
53 error     node_modules/nuxt3
53 error       dev nuxt3@"latest" from the root project
53 error   peer vue@"3.2.29" from @nuxt/webpack-builder@3.0.0-27398533.8edd481
53 error   node_modules/@nuxt/webpack-builder
53 error     @nuxt/webpack-builder@"npm:@nuxt/webpack-builder-edge@3.0.0-27398533.8edd481" from nuxt3@3.0.0-27398533.8edd481
53 error     node_modules/nuxt3
53 error       dev nuxt3@"latest" from the root project
53 error   5 more (@vitejs/plugin-vue, @vue/server-renderer, ...)
53 error
53 error Could not resolve dependency:
53 error @pinia/nuxt@"*" from the root project
53 error
53 error Conflicting peer dependency: vue@2.6.14
53 error node_modules/vue
53 error   peer vue@">= 2.5 < 3" from @vue/composition-api@1.4.5
53 error   node_modules/@vue/composition-api
53 error     peerOptional @vue/composition-api@"^1.4.0" from pinia@2.0.11
53 error     node_modules/pinia
53 error       peer pinia@"~2.0.9" from @pinia/nuxt@0.1.8
53 error       node_modules/@pinia/nuxt
53 error         @pinia/nuxt@"*" 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 /Users/lukeoliff/.npm/eresolve-report.txt for a full report.
54 verbose exit 1

Steps to reproduce the behavior

  1. Follow nuxt3 getting started
  2. Follow Pinia getting started
  3. See error

Expected behavior

Actual behavior

Additional information

As expected, works fine when ignoring peer-deps.

npm install pinia @pinia/nuxt --legacy-peer-deps
@LinusBorg
Copy link
Member

LinusBorg commented Feb 5, 2022

That's npm's issue, I'd say. Pinia has this peerDependency config:

"vue": "^2.6.14 || ^3.2.0"

...which is totally fine. @vue/composition-api is an optional peerDependency of pinia, which I presume you didn't install. So npm should ignore the fact that that package would require Vue 2 if it were installed, which it isn't.

@posva
Copy link
Member

posva commented Feb 6, 2022

Duplicate of #853

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants