npm install antd --save出现错误ERESOLVE unable to resolve dependency

shuidaan
  • 2
新手上路,请多包涵

node js v13.14.0

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: first_ble_demo@0.0.1
npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR! react@"16.13.1" from the root project
npm ERR! peer react@">=16.9.0" from antd@4.12.3
npm ERR! node_modules/antd
npm ERR! antd@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-dom@17.0.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@">=16.9.0" from antd@4.12.3
npm ERR! node_modules/antd
npm ERR! antd@"*" 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\Administrator.USER-20191030HC\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\Administrator.USER-20191030HC\AppData\Local\npm-cache\_logs\2021-02-26T08_10_44_371Z-debug.log
————————————————————————————————————————————————————————————————————————————
http fetch GET 304 https://registry.npm.taobao.o... 528ms (from cache)
28 silly fetch manifest react@16.13.1
29 http fetch GET 304 https://registry.npm.taobao.o... 27ms (from cache)
30 silly fetch manifest react-dom@>=16.9.0
31 http fetch GET 304 https://registry.npm.taobao.o... 24ms (from cache)
32 timing idealTree Completed in 1183ms
33 timing command:install Completed in 1197ms
34 verbose stack Error: unable to resolve dependency tree
34 verbose stack at Arborist.[failPeerConflict] (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1136:25)
34 verbose stack at Arborist.[loadPeerSet] (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1129:30)
34 verbose stack at Arborist.[nodeFromEdge] (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:927:30)
34 verbose stack at async Arborist.[loadPeerSet] (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1092:11)
34 verbose stack at async Arborist.[buildDepStep] (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:834:11)
34 verbose stack at async Arborist.buildIdealTree (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:209:7)
34 verbose stack at async Promise.all (index 1)
34 verbose stack at async Arborist.reify (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:127:5)
34 verbose stack at async install (C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\lib\install.js:38:3)
35 verbose cwd D:\rn\first_ble_demo
36 verbose Windows_NT 6.1.7601
37 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Administrator.USER-20191030HC\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "antd"
38 verbose node v12.10.0
39 verbose npm v7.5.4
40 error code ERESOLVE
41 error ERESOLVE unable to resolve dependency tree
42 error
43 error While resolving: [1mfirst_ble_demo[22m@[1m0.0.1[22m
43 error Found: [1mreact[22m@[1m16.13.1[22m[2m[22m
43 error [2mnode_modules/react[22m
43 error [1mreact[22m@"[1m16.13.1[22m" from the root project
43 error [35mpeer[39m [1mreact[22m@"[1m>=16.9.0[22m" from [1mantd[22m@[1m4.12.3[22m[2m[22m
43 error [2mnode_modules/antd[22m
43 error [1mantd[22m@"[1m*[22m" from the root project
43 error
43 error Could not resolve dependency:
43 error [35mpeer[39m [1mreact[22m@"[1m17.0.1[22m" from [1mreact-dom[22m@[1m17.0.1[22m[2m[22m
43 error [2mnode_modules/react-dom[22m
43 error [35mpeer[39m [1mreact-dom[22m@"[1m>=16.9.0[22m" from [1mantd[22m@[1m4.12.3[22m[2m[22m
43 error [2mnode_modules/antd[22m
43 error [1mantd[22m@"[1m*[22m" from the root project
43 error
43 error Fix the upstream dependency conflict, or retry
43 error this command with --force, or --legacy-peer-deps
43 error to accept an incorrect (and potentially broken) dependency resolution.
43 error
43 error See C:\Users\Administrator.USER-20191030HC\AppData\Local\npm-cache\eresolve-report.txt for a full report.
44 verbose exit 1

回复
阅读 1.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
你知道吗?

宣传栏