Categories
JavaScript Answers

How to fix the “Failed to compile. Module not found: Can’t resolve ‘react-router-dom'” error with JavaScript?

Spread the love

To fix the "Failed to compile. Module not found: Can’t resolve ‘react-router-dom’" error with JavaScript, we install the react-router-dom package.

To install it, we run

npm i react-router-dom

Then we install its type definitions with

npm i @types/react-router-dom

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *