当我试图使用此命令安装reactstrap时,但无法安装reactstrap。
npm install reactstrap --save那一次我得到了这个错误
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 4 more (react-dom, react-popper, the root project, reactstrap)
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! 1 more (reactstrap)
npm ERR! 3 more (react-popper, the root project, reactstrap)
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\prajjkum\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\prajjkum\AppData\Local\npm-cache\_logs\2020-12-26T11_13_07_327Z-debug.log那么如何解决这个错误请帮助我..。我试着卸载,然后再安装,但是它不再起作用了,所以我把它张贴在这里
发布于 2020-12-28 11:06:54
这里的问题显然是npm 7的问题。不幸的是,我没有得到你的设置的错误,但只有警告,我不知道为什么。
如果问题确实与国家预防机制有关,我可以提出两点建议:
npm install --save reactstrap --legacy-peer-deps andnpx -p npm@6 npm install.在继续执行任何步骤之前,请确保删除node_modules和package-lock.json。
https://stackoverflow.com/questions/65455874
复制相似问题