StephenGrider / ReduxSimpleStarter

Starter pack for an awesome Udemy course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fixed Cannot resolve module 'react-router-dom'

4mifix opened this issue · comments

Lecture 121 time on video around 5:45

The router has to be installed with npm i react-router-dom --save

ERROR in ./src/index.js
Module not found: Error: Cannot resolve module 'react-router-dom' in /Users/brianmayers/blog/src
@ ./src/index.js 17:22-49

Thanks for this!

All the instructions said to install react-router but then my imports would fail for react-router-dom.

Changing the package.json dependency to react-router-dom worked great.

did you install react, react-dom, react-router-dom?

If not are not installed then :>>
npm i react react-dom react-router-dom

did you install react, react-dom, react-router-dom?

If not are not installed then :>>
npm i react react-dom react-router-dom

Thanks @ShravanMeena, this solved the issue for my "cannot find module 'rea ct-router-dom'" problem.

commented

Woooow Thanks @ShravanMeena,...God bless you, it solved the problem of cannot find module 'react-router-dom' instantly

Problem solved fast and easy , thanks !

Implicitly referencing the type worked for me: **npm install --save @types/react-router-dom**

I didn't solve it🫠