首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关于反作用带安装

关于反作用带安装
EN

Stack Overflow用户
提问于 2020-12-26 11:20:53
回答 1查看 233关注 0票数 1

当我试图使用此命令安装reactstrap时,但无法安装reactstrap。

代码语言:javascript
复制
npm install reactstrap --save

那一次我得到了这个错误

代码语言:javascript
复制
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

那么如何解决这个错误请帮助我..。我试着卸载,然后再安装,但是它不再起作用了,所以我把它张贴在这里

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-28 11:06:54

这里的问题显然是npm 7的问题。不幸的是,我没有得到你的设置的错误,但只有警告,我不知道为什么。

如果问题确实与国家预防机制有关,我可以提出两点建议:

  1. npm install --save reactstrap --legacy-peer-deps and
  2. npx -p npm@6 npm install.

在继续执行任何步骤之前,请确保删除node_modules和package-lock.json。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65455874

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档