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

8.8k Views Asked by At

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.

2

There are 2 best solutions below

1
ej2brown On

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?

0
Sampath Bandara On

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

yarn add react-router-dom