vuestorefront / shopify

Vue Storefront 2 integration for Shopify
https://docs.vuestorefront.io/shopify
MIT License
150 stars 84 forks source link

[Bug]: Unable to resolve dependency tree #331

Closed yapyeeqiang closed 2 years ago

yapyeeqiang commented 2 years ago

Describe the Bug

The jest dependency is not able to be resolve, maybe because of outdated version.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @vue-storefront/shopify-theme@1.0.13
npm ERR! Found: jest@27.5.1
npm ERR! node_modules/jest
npm ERR!   dev jest@"^27.4.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer jest@"26.x" from vue-jest@4.0.1
npm ERR! node_modules/vue-jest
npm ERR!   dev vue-jest@"^4.0.0-0" 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.

Current behavior

After running npm install, while installing the dependencies, the jest and vue-jest dependencies are not able to be resolved.

Expected behavior

Should be able to install all the dependencies successfully without error.

Steps to reproduce

  1. npm install

What version of Vue Storefront are you using?

2.5.0

What version of Node.js are you using?

17.3.0

What browser (and version) are you using?

Chrome

What operating system (and version) are you using?

macOS

Relevant log output

0 verbose cli [
0 verbose cli   '/opt/homebrew/Cellar/node/17.3.0/bin/node',
0 verbose cli   '/opt/homebrew/bin/npm',
0 verbose cli   'i'
0 verbose cli ]
1 info using npm@8.3.0
2 info using node@v17.3.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/yapyeeqiang/playground/vue-storefront-test/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/Users/yapyeeqiang/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/Users/yapyeeqiang/projects/mr-coding-discord-bot/node_modules/node/etc/npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 8ms
19 timing npm:load:configload Completed in 8ms
20 timing npm:load:setTitle Completed in 2ms
21 timing config:load:flatten Completed in 1ms
22 timing npm:load:display Completed in 2ms
23 verbose logfile /Users/yapyeeqiang/.npm/_logs/2022-02-18T06_21_06_156Z-debug-0.log
24 timing npm:load:logFile Completed in 2ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 14ms
28 timing arborist:ctor Completed in 0ms
29 silly logfile start cleaning logs, removing 1 files
30 timing arborist:ctor Completed in 0ms
31 timing idealTree:init Completed in 6ms
32 timing idealTree:userRequests Completed in 0ms
33 silly idealTree buildDeps
34 silly fetch manifest @nuxtjs/device@^2.1.0
35 http fetch GET 200 https://registry.npmjs.org/@nuxtjs%2fdevice 9ms (cache hit)
36 silly fetch manifest @nuxtjs/pwa@^3.3.5
37 http fetch GET 200 https://registry.npmjs.org/@nuxtjs%2fpwa 4ms (cache hit)
38 silly fetch manifest @nuxtjs/style-resources@^1.0.0
39 http fetch GET 200 https://registry.npmjs.org/@nuxtjs%2fstyle-resources 3ms (cache hit)
40 silly fetch manifest @storefront-ui/vue@^0.11.4
41 http fetch GET 200 https://registry.npmjs.org/@storefront-ui%2fvue 2ms (cache hit)
42 silly fetch manifest @vue-storefront/middleware@~2.5.0
43 http fetch GET 200 https://registry.npmjs.org/@vue-storefront%2fmiddleware 2ms (cache hit)
44 silly fetch manifest @vue-storefront/nuxt@~2.5.0
45 http fetch GET 200 https://registry.npmjs.org/@vue-storefront%2fnuxt 3ms (cache hit)
46 silly fetch manifest @vue-storefront/nuxt-theme@~2.5.0
47 http fetch GET 200 https://registry.npmjs.org/@vue-storefront%2fnuxt-theme 2ms (cache hit)
48 silly fetch manifest @nuxtjs/composition-api@^0.29.3
49 http fetch GET 200 https://registry.npmjs.org/@nuxtjs%2fcomposition-api 2ms (cache hit)
50 silly fetch manifest @nuxt/vue-app@^2.15
51 http fetch GET 200 https://registry.npmjs.org/@nuxt%2fvue-app 4ms (cache hit)
52 silly fetch manifest nuxt@^2.13.3
53 http fetch GET 200 https://registry.npmjs.org/nuxt 4ms (cache hit)
54 silly fetch manifest vue@^2
55 http fetch GET 200 https://registry.npmjs.org/vue 4ms (cache hit)
56 silly fetch manifest @vue-storefront/shopify@^1.0.13
57 http fetch GET 200 https://registry.npmjs.org/@vue-storefront%2fshopify 2ms (cache hit)
58 silly fetch manifest @nuxtjs/composition-api@0.29.3
59 silly fetch manifest cookie-universal-nuxt@^2.1.3
60 http fetch GET 200 https://registry.npmjs.org/cookie-universal-nuxt 2ms (cache hit)
61 silly fetch manifest core-js@^3.19.1
62 http fetch GET 200 https://registry.npmjs.org/core-js 2ms (cache hit)
63 silly fetch manifest isomorphic-fetch@^2.2.1
64 http fetch GET 200 https://registry.npmjs.org/isomorphic-fetch 3ms (cache hit)
65 silly fetch manifest nuxt-i18n@^6.5.0
66 http fetch GET 200 https://registry.npmjs.org/nuxt-i18n 3ms (cache hit)
67 silly fetch manifest vee-validate@^3.2.3
68 http fetch GET 200 https://registry.npmjs.org/vee-validate 4ms (cache hit)
69 silly fetch manifest vue@^2.5.18
70 silly fetch manifest vue-scrollto@^2.17.1
71 http fetch GET 200 https://registry.npmjs.org/vue-scrollto 3ms (cache hit)
72 silly fetch manifest @nuxt/types@^2.13.3
73 http fetch GET 200 https://registry.npmjs.org/@nuxt%2ftypes 1ms (cache hit)
74 silly fetch manifest @nuxt/typescript-build@^2.0.0
75 http fetch GET 200 https://registry.npmjs.org/@nuxt%2ftypescript-build 5ms (cache hit)
76 silly fetch manifest @vue/test-utils@^1.0.0-beta.27
77 http fetch GET 200 https://registry.npmjs.org/@vue%2ftest-utils 2ms (cache hit)
78 silly fetch manifest vue@2.x
79 silly fetch manifest vue-template-compiler@^2.x
80 http fetch GET 200 https://registry.npmjs.org/vue-template-compiler 2ms (cache hit)
81 silly fetch manifest babel-jest@^24.1.0
82 http fetch GET 200 https://registry.npmjs.org/babel-jest 3ms (cache hit)
83 silly fetch manifest @babel/core@^7.0.0
84 http fetch GET 200 https://registry.npmjs.org/@babel%2fcore 3ms (cache hit)
85 silly fetch manifest cypress@^9.1.0
86 http fetch GET 200 https://registry.npmjs.org/cypress 2ms (cache hit)
87 silly fetch manifest ejs@^3.0.2
88 http fetch GET 200 https://registry.npmjs.org/ejs 2ms (cache hit)
89 silly fetch manifest jest@^27.4.3
90 http fetch GET 200 https://registry.npmjs.org/jest 3ms (cache hit)
91 silly fetch manifest node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0
92 http fetch GET 200 https://registry.npmjs.org/node-notifier 2ms (cache hit)
93 silly fetch manifest lint-staged@^11.1.2
94 http fetch GET 200 https://registry.npmjs.org/lint-staged 3ms (cache hit)
95 silly fetch manifest start-server-and-test@^1.14.0
96 http fetch GET 200 https://registry.npmjs.org/start-server-and-test 3ms (cache hit)
97 silly fetch manifest vue-jest@^4.0.0-0
98 http fetch GET 200 https://registry.npmjs.org/vue-jest 4ms (cache hit)
99 silly fetch manifest @babel/core@7.x
100 silly fetch manifest jest@26.x
101 timing idealTree Completed in 162ms
102 timing command:i Completed in 169ms
103 verbose stack Error: unable to resolve dependency tree
103 verbose stack     at Arborist.[failPeerConflict] (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1362:25)
103 verbose stack     at Arborist.[loadPeerSet] (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1328:34)
103 verbose stack     at async Arborist.[buildDepStep] (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:935:11)
103 verbose stack     at async Arborist.buildIdealTree (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:216:7)
103 verbose stack     at async Promise.all (index 1)
103 verbose stack     at async Arborist.reify (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:149:5)
103 verbose stack     at async Install.exec (/opt/homebrew/lib/node_modules/npm/lib/commands/install.js:157:5)
103 verbose stack     at async module.exports (/opt/homebrew/lib/node_modules/npm/lib/cli.js:66:5)
104 verbose cwd /Users/yapyeeqiang/playground/vue-storefront-test
105 verbose Darwin 21.1.0
106 verbose argv "/opt/homebrew/Cellar/node/17.3.0/bin/node" "/opt/homebrew/bin/npm" "i"
107 verbose node v17.3.0
108 verbose npm  v8.3.0
109 error code ERESOLVE
110 error ERESOLVE unable to resolve dependency tree
111 error
112 error While resolving: @vue-storefront/shopify-theme@1.0.13
112 error Found: jest@27.5.1
112 error node_modules/jest
112 error   dev jest@"^27.4.3" from the root project
112 error
112 error Could not resolve dependency:
112 error peer jest@"26.x" from vue-jest@4.0.1
112 error node_modules/vue-jest
112 error   dev vue-jest@"^4.0.0-0" from the root project
112 error
112 error Fix the upstream dependency conflict, or retry
112 error this command with --force, or --legacy-peer-deps
112 error to accept an incorrect (and potentially broken) dependency resolution.
112 error
112 error See /Users/yapyeeqiang/.npm/eresolve-report.txt for a full report.
113 verbose exit 1
114 timing npm Completed in 314ms
115 verbose unfinished npm timer reify 1645165266299
116 verbose unfinished npm timer reify:loadTrees 1645165266304
117 verbose unfinished npm timer idealTree:buildDeps 1645165266311
118 verbose unfinished npm timer idealTree:#root 1645165266312
119 verbose code 1
120 error A complete log of this run can be found in:
120 error     /Users/yapyeeqiang/.npm/_logs/2022-02-18T06_21_06_156Z-debug-0.log

Able to fix / change the documentation?

Code of Conduct

torra commented 2 years ago

I've run into the same problem in a generated project (ie a project generated from npx @vue-storefront/cli init). I had to use npm install --legacy-peer-deps in order to get it to work.

jeffpdotone commented 2 years ago

We recommend using node 14 and npm 6 for this matter or use yarn package manager. Let us know if the issue still persists.