【发布时间】:2020-12-25 06:53:24
【问题描述】:
如果安装 react-icons、reactstrap 和 react-toastify
C:\Users\Anupam K Krishnan\Desktop\React20\four-tictactoe>npm install react-icons reactstrap react-toastify
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! peer react@"*" from @testing-library/react@11.2.2
npm ERR! node_modules/@testing-library/react
npm ERR! @testing-library/react@"^11.2.2" from the root project
npm ERR! peer react@"17.0.1" from react-dom@17.0.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@"*" from @testing-library/react@11.2.2
npm ERR! node_modules/@testing-library/react
npm ERR! @testing-library/react@"^11.2.2" from the root project
npm ERR! react-dom@"^17.0.1" from the root project
npm ERR! 2 more (reactstrap, react-transition-group)
npm ERR! 5 more (the root project, react-icons, react-toastify, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"0.14.x || ^15.0.0 || ^16.0.0" from react-popper@1.3.7
npm ERR! node_modules/reactstrap/node_modules/react-popper
npm ERR! react-popper@"^1.3.6" from reactstrap@8.8.0
npm ERR! node_modules/reactstrap
npm ERR! reactstrap@"*" 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\Anupam K Krishnan\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\Anupam K Krishnan\AppData\Local\npm-cache\_logs\2020-12-25T16_47_42_992Z-debug.log
如果使用--force
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN peer react@"*" from @testing-library/react@11.2.2
npm WARN node_modules/@testing-library/react
npm WARN @testing-library/react@"^11.2.2" from the root project
npm WARN 6 more (react-dom, the root project, react-icons, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"0.14.x || ^15.0.0 || ^16.0.0" from react-popper@1.3.7
npm WARN node_modules/reactstrap/node_modules/react-popper
npm WARN react-popper@"^1.3.6" from reactstrap@8.8.0
npm WARN node_modules/reactstrap
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN peer react@"*" from @testing-library/react@11.2.2
npm WARN node_modules/@testing-library/react
npm WARN @testing-library/react@"^11.2.2" from the root project
npm WARN 6 more (react-dom, the root project, react-icons, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"0.14.x || ^15.0.0 || ^16.0.0" from react-popper@1.3.7
npm WARN node_modules/reactstrap/node_modules/react-popper
npm WARN react-popper@"^1.3.6" from reactstrap@8.8.0
npm WARN node_modules/reactstrap
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! peer react@"*" from @testing-library/react@11.2.2
npm ERR! node_modules/@testing-library/react
npm ERR! @testing-library/react@"^11.2.2" from the root project
npm ERR! peer react@"17.0.1" from react-dom@17.0.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@"*" from @testing-library/react@11.2.2
npm ERR! node_modules/@testing-library/react
npm ERR! @testing-library/react@"^11.2.2" from the root project
npm ERR! react-dom@"^17.0.1" from the root project
npm ERR! 2 more (reactstrap, react-transition-group)
npm ERR! 5 more (the root project, react-icons, react-toastify, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.3.0
npm ERR! node_modules/reactstrap/node_modules/create-react-context
npm ERR! create-react-context@"^0.3.0" from react-popper@1.3.7
npm ERR! node_modules/reactstrap/node_modules/react-popper
npm ERR! react-popper@"^1.3.6" from reactstrap@8.8.0
npm ERR! node_modules/reactstrap
npm ERR! reactstrap@"*" 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\Anupam K Krishnan\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\Anupam K Krishnan\AppData\Local\npm-cache\_logs\2020-12-25T17_16_41_640Z-debug.log
还尝试使用 SKIP_PREFLIGHT_CHECK=true 添加 .env 文件 即使这样也行不通
安装 reactstrap 时出现所有这些错误
我尝试了什么
1)删除节点模块和package-lock.json
2) 更新了 npm
3)重新安装npm
即使我尝试过 --force 但什么也没发生
还是有错误
【问题讨论】:
-
贴出你的错误,而不是图片,安装reactstrap时的错误是什么,你能单独发一下吗
-
您尝试此操作时遇到的错误是什么
npm i -S reactstrap -
@Anupam Kumar Krishnan 与其在评论中留下错误,不如编辑并粘贴您的问题。