Reputation: 57
I am getting the error shown below after running the react-router-dom
command
how to fix this?
./node_modules/create-react-context/lib/implementation.js Module not found: Can't resolve 'react' in 'C:\xampp\htdocs\learn-router\node_modules\create-react-context\lib'
Upvotes: 1
Views: 1466
Reputation: 5912
Add react-router-dom
directly to dependencies
list in package.json
file.
"react-router-dom": "^4.3.1",
then run below command in your project root directory.
npm install
Upvotes: 0
Reputation: 1556
you have to install react first before installing react-router-dom package,
try this:
rm -rf node_modules
npm i react react-router-dom --save
Upvotes: 1