作为标题,当我尝试在终端中运行npm @stripe/ run stripe-js@1.4.0@stripe/stripe@1.13.2 -s,但未能安装。
它只是像这样简单地表现出来
当我尝试运行npm @stripe/ run stripe-js@1.4.0@stripe/stripe@1.13.2(没有-s )时,它将在终端中显示以下消息:
国家预防机制错误!代码ERESOLVE
国家预防机制错误!ERESOLVE无法解决
国家预防机制错误!
国家预防机制错误!解析时:@react库/react@13.4.0
国家预防机制错误!发现: react@17.0.2
国家预防机制错误!节点模块/反应
国家预防机制错误!来自“重新启动/上下文@2.1.4”的对等方响应@“>=16.3.2”
国家预防机制错误!节点_模块/@重新启动/上下文
npm ERR!@restart/context@"^2.1.4“(从react)开始-bootstrap@1.5.2
国家预防机制错误!节点模块/响应-引导
国家预防机制错误!根项目中的the bootstrap@“^1.5.2”
国家预防机制错误!从重新启动/钩子@0.3.27中对等方反应@“>=16.8.0”
国家预防机制错误!节点_模块/@重新启动/钩子
npm ERR!@restart/hooks@"^0.3.26“从react开始-bootstrap@1.5.2
国家预防机制错误!节点模块/响应-引导
国家预防机制错误!根项目中的the bootstrap@“^1.5.2”
npm错误!19 (道具类型-额外,qrcode.react,反应-引导,.)
国家预防机制错误!
国家预防机制错误!无法解析依赖关系:
国家预防机制错误!来自“testing库/ peer @13.4.0”的对等反应@“^18.0.0”
国家预防机制错误!节点_模块/@测试-库/反应
npm ERR!@ the库/the@“^13.4.0”来自根项目
国家预防机制错误!
国家预防机制错误!相互冲突的对等依赖: react@18.2.0
国家预防机制错误!节点模块/反应
国家预防机制错误!来自“testing库/ peer @13.4.0”的对等反应@“^18.0.0”
国家预防机制错误!节点_模块/@测试-库/反应
npm ERR!@ the库/the@“^13.4.0”来自根项目
国家预防机制错误!
国家预防机制错误!修复上游依赖冲突,或重试
国家预防机制错误!此命令与--force或--legacy-peer-deps一起使用
国家预防机制错误!接受不正确的(并且可能被破坏的)依赖项解析。
国家预防机制错误!
国家预防机制错误!完整报告见/Users/chingkarlok/..npm/eresolve-report.txt。
国家预防机制错误!可以在以下位置找到此运行的完整日志:
npm错误!/Users/chingkarlok/.npm/_logs/2022-10-06T03_42_21_140Z-debug-0.log
下面是在/Users/chingkarlok/.npm/_logs/2022-10-06T03_42_21_140Z-debug-0.log中找到的这个运行的完整日志
1 info using npm@8.15.0
2 info using node@v16.17.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 0ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/chingkarlok/Desktop/QRMenu/qrmenu_frontend/.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:/Users/chingkarlok/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/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 0ms
18 timing config:load Completed in 5ms
19 timing npm:load:configload Completed in 5ms
20 timing npm:load:mkdirpcache Completed in 2ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm install @stripe/react-stripe-js@1.4.0 @stripe/stripe-js@1.13.2
23 verbose argv "install" "@stripe/react-stripe-js@1.4.0" "@stripe/stripe-js@1.13.2"
24 timing npm:load:setTitle Completed in 9ms
25 timing config:load:flatten Completed in 1ms
26 timing npm:load:display Completed in 2ms
27 verbose logfile logs-max:10 dir:/Users/chingkarlok/.npm/_logs
28 verbose logfile /Users/chingkarlok/.npm/_logs/2022-10-06T03_42_21_140Z-debug-0.log
29 timing npm:load:logFile Completed in 2ms
30 timing npm:load:timers Completed in 1ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 22ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 1 files
35 silly logfile done cleaning log files
36 timing idealTree:init Completed in 325ms
37 timing idealTree:userRequests Completed in 1ms
38 silly idealTree buildDeps
39 silly fetch manifest @stripe/react-stripe-js@1.4.0
40 timing arborist:ctor Completed in 0ms
41 http fetch GET 200 https://registry.npmjs.org/@stripe%2freact-stripe-js 265ms (cache hit)
42 silly fetch manifest @stripe/stripe-js@1.13.2
43 http fetch GET 200 https://registry.npmjs.org/@stripe%2fstripe-js 5ms (cache hit)
44 silly fetch manifest react@^17.0.2
45 http fetch GET 200 https://registry.npmjs.org/react 5ms (cache hit)
46 silly fetch manifest react-dom@^17.0.2
47 http fetch GET 200 https://registry.npmjs.org/react-dom 5ms (cache hit)
48 silly placeDep ROOT @stripe/react-stripe-js@1.4.0 OK for: qrmenu_frontend@0.1.0 want: 1.4.0
49 silly placeDep ROOT @stripe/stripe-js@1.13.2 OK for: @stripe/react-stripe-js@1.4.0 want: ^1.13.0
50 silly placeDep ROOT @stripe/stripe-js@1.13.2 REPLACE for: qrmenu_frontend@0.1.0 want: 1.13.2
51 timing idealTree:#root Completed in 303ms
52 timing idealTree:node_modules/@stripe/react-stripe-js Completed in 0ms
53 timing idealTree:node_modules/@stripe/stripe-js Completed in 0ms
54 silly fetch manifest react@^18.0.0
55 silly fetch manifest react-dom@^18.0.0
56 timing idealTree Completed in 632ms
57 timing command:install Completed in 641ms
58 verbose stack Error: could not resolve
58 verbose stack at PlaceDep.failPeerConflict (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:549:25)
58 verbose stack at PlaceDep.place (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:199:21)
58 verbose stack at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:73:10)
58 verbose stack at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:990:31
58 verbose stack at Array.map (<anonymous>)
58 verbose stack at Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:990:8)
58 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7)
58 verbose stack at async Promise.all (index 1)
58 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:154:5)
58 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:145:5)
59 verbose cwd /Users/chingkarlok/Desktop/QRMenu/qrmenu_frontend
60 verbose Darwin 20.3.0
61 verbose node v16.17.0
62 verbose npm v8.15.0
63 error code ERESOLVE
64 error ERESOLVE could not resolve
65 error
66 error While resolving: [1m@testing-library/react[22m@[1m13.4.0[22m
66 error Found: [1mreact[22m@[1m17.0.2[22m[2m[22m
66 error [2mnode_modules/react[22m
66 error [35mpeer[39m [1mreact[22m@"[1m>=16.3.2[22m" from [1m@restart/context[22m@[1m2.1.4[22m[2m[22m
66 error [2mnode_modules/@restart/context[22m
66 error [1m@restart/context[22m@"[1m^2.1.4[22m" from [1mreact-bootstrap[22m@[1m1.5.2[22m[2m[22m
66 error [2mnode_modules/react-bootstrap[22m
66 error [1mreact-bootstrap[22m@"[1m^1.5.2[22m" from the root project
66 error [35mpeer[39m [1mreact[22m@"[1m>=16.8.0[22m" from [1m@restart/hooks[22m@[1m0.3.27[22m[2m[22m
66 error [2mnode_modules/@restart/hooks[22m
66 error [1m@restart/hooks[22m@"[1m^0.3.26[22m" from [1mreact-bootstrap[22m@[1m1.5.2[22m[2m[22m
66 error [2mnode_modules/react-bootstrap[22m
66 error [1mreact-bootstrap[22m@"[1m^1.5.2[22m" from the root project
66 error 19 more (prop-types-extra, qrcode.react, react-bootstrap, ...)
66 error
66 error Could not resolve dependency:
66 error [35mpeer[39m [1mreact[22m@"[1m^18.0.0[22m" from [1m@testing-library/react[22m@[1m13.4.0[22m[2m[22m
66 error [2mnode_modules/@testing-library/react[22m
66 error [1m@testing-library/react[22m@"[1m^13.4.0[22m" from the root project
66 error
66 error Conflicting peer dependency: [1mreact[22m@[1m18.2.0[22m[2m[22m
66 error [2mnode_modules/react[22m
66 error [35mpeer[39m [1mreact[22m@"[1m^18.0.0[22m" from [1m@testing-library/react[22m@[1m13.4.0[22m[2m[22m
66 error [2mnode_modules/@testing-library/react[22m
66 error [1m@testing-library/react[22m@"[1m^13.4.0[22m" from the root project
66 error
66 error Fix the upstream dependency conflict, or retry
66 error this command with --force, or --legacy-peer-deps
66 error to accept an incorrect (and potentially broken) dependency resolution.
66 error
66 error See /Users/chingkarlok/.npm/eresolve-report.txt for a full report.
67 verbose exit 1
68 timing npm Completed in 723ms
69 verbose unfinished npm timer reify 1665027741218
70 verbose unfinished npm timer reify:loadTrees 1665027741226
71 verbose unfinished npm timer idealTree:buildDeps 1665027741552
72 verbose unfinished npm timer idealTree:node_modules/@testing-library/react 1665027741855
73 verbose code 1
74 error A complete log of this run can be found in:
74 error /Users/chingkarlok/.npm/_logs/2022-10-06T03_42_21_140Z-debug-0.log
package.json
"name": "qrmenu_frontend",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:8000",
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"bootstrap": "^4.6.0",
"qrcode.react": "^3.1.0",
"react": "^17.0.2",
"react-bootstrap": "^1.5.2",
"react-dom": "^17.0.2",
"react-dropzone": "^11.3.2",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-to-print": "^2.14.7",
"react-toastify": "^7.0.3",
"styled-components": "^5.2.3",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
我能知道这是怎么回事吗?
发布于 2022-10-06 05:49:43
看起来在react@18.2.0和react@17.0.2之间存在依赖冲突。你为什么不直接跑
npm install --save @stripe/react-stripe-js @stripe/stripe-js
就像条纹医生建议的那样?
https://stackoverflow.com/questions/73968544
复制相似问题