简体   繁体   English

npm install react-router-dom .... 不工作,我收到以下消息

[英]npm install react-router-dom.... isn't working and i am getting the following msg

Packet.json 文件 在此处输入图片说明 My command prompt wasn't able to install react-router-dom due to 3 moderate severity vulnerabilities run npm audit fix to fix them, or npm audit for details vulnerabilities that were found, and npm audit fix is not fixing anything.由于 3 个中等严重性漏洞,我的命令提示符无法安装 react-router-dom 运行npm audit fix来修复它们,或者npm audit以获取发现的详细漏洞,并且 npm audit fix 没有修复任何内容。 It says that all 3 vulnerabilities should be reviewed manually, how can this be fixed?它说应该手动审查所有 3 个漏洞,如何修复? Many thanks in advance.提前谢谢了。

It looks like react-router-dom version 5.2.0 was installed, is the problem that it isn't working properly?貌似安装了react-router-dom 5.2.0版本,是不是不能正常工作的问题?

Try:尝试:

  1. deleting your node_modules and package-lock.json删除你的 node_modules 和 package-lock.json
  2. remove react, react-router and react-router-dom dependencies from package.json file从 package.json 文件中删除 react、react-router 和 react-router-dom 依赖项
  3. and then try npm install react react-router react-router-dom --save.然后尝试 npm install react react-router react-router-dom --save。
    *note react version should match react-dom *注意反应版本应该匹配反应DOM

If that doesnt do the trick, could you provide more context like whats in the package.json?如果这不起作用,您能否提供更多上下文,例如 package.json 中的内容?

我遇到了同样的错误,用纱线代码解决了问题,试试这个命令..

yarn add react-router-dom

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想使用“npm install react-router-dom”安装 react router dom,但我收到了我不知道如何解决的错误。? - I want to install react router dom using "npm install react-router-dom" but I am getting the errors which i don't know how to solve.? 在为 React 项目工作一段时间后,我收到所有“npm install”命令的以下错误 - I am getting following error for all 'npm install' commands after some time working for React project 为什么 npm 安装 react-router-dom 不起作用? - Why is npm install react-router-dom not working? 运行 npm i --save react-router-dom 后出现错误 - After running npm i --save react-router-dom i am getting error 嵌套路由不适用于 react-router-dom - Nested Routing isn't working with react-router-dom npm install react-router-dom和npm install --save react-router-dom命令之间的区别 - difference between npm install react-router-dom and npm install --save react-router-dom command react-router-dom 出现错误,我无法解决 - Getting an error with react-router-dom, that I can't solve 我不能使用npm安装任何软件包(需要react-router-dom) - I cannot install any package using npm (need for react-router-dom) 为什么我的反应路由器无法正常工作? 点击后网址会更改,但DOM上不会显示 - Why isn't my react-router working? URL changes on click but no display on DOM 如何在 vscode 上安装以下依赖项 sass 和 react-router-dom? - how to install on vscode the following dependencies sass and react-router-dom?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM