0

Packet.json fileenter image description hereMy 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. It says that all 3 vulnerabilities should be reviewed manually, how can this be fixed? Many thanks in advance.

  • 1
    I think the package is installed. The WARN and the audit fix message are just to tell you that there are unresolved/missing or old dependencies among the packages. This happens as not all the packages are in sync with each-other and not always updated/maintained by their developer(s). It should not be causing problem. Is react-router-dom still not working? – Gaurav Jul 25 '21 at 14:41
  • hi , the router-dom isn't installed as whenever i try to install it , it tells me to get rid of the 3 vulnerabilities manually – Tallal Shahid Jul 25 '21 at 15:10
  • There's no indication that react-router-dom was NOT installed. In addition try following the instructions provided by the warning messages to fix the vulnerabilities of the other packages. – im_baby Jul 25 '21 at 15:23
  • okay so u are saying that its not written that its not install to run. the code to test if the router works or not and it doesn't so we can say its not installed and secondly can u tell me how to install peer dependencies as i have told before that i am completely new in React – Tallal Shahid Jul 25 '21 at 17:32
  • Open a new question with the errors you are receiving with react router dom. Post your code as well because it does not appear to be an issue with npm. – im_baby Jul 26 '21 at 13:53

2 Answers2

0

It looks like react-router-dom version 5.2.0 was installed, is the problem that it isn't working properly?

Try:

  1. deleting your node_modules and package-lock.json
  2. remove react, react-router and react-router-dom dependencies from package.json file
  3. and then try npm install react react-router react-router-dom --save

note react version should match react-dom

If that doesnt do the trick, could you provide more context like whats in the package.json?

Fudge
  • 49
  • 4
ej2brown
  • 16
  • 3
  • hi , the router-dom isn't installed as whenever i try to install it , it tells me to get rid of the 3 vulnerabilities manually – Tallal Shahid Jul 25 '21 at 15:07
0

i've got the same error, problem solved with yarn code try with this command..

yarn add react-router-dom