Error: Cannot Find Module ‘react-dev-utils/watchmissingnodemodulesplugin’
This error usually occurs when the required module ‘react-dev-utils/watchmissingnodemodulesplugin’ is missing or not installed in the project.
To fix this error, you can follow these steps:
- First, you need to check if the ‘react-dev-utils/watchmissingnodemodulesplugin’ module is included as a dependency in your project’s package.json file. Open the package.json file and make sure it is listed under the dependencies or devDependencies section. If it is not present, you need to install it.
- To install the ‘react-dev-utils/watchmissingnodemodulesplugin’ module, open your terminal and navigate to the root folder of your project. Then run the following command:
- After installing the module, you might need to restart your development server for the changes to take effect. If you are using a local development server, such as webpack-dev-server or create-react-app’s default development server, you can simply stop the server by pressing Ctrl+C in the terminal and start it again using the appropriate command.
npm install react-dev-utils
This will install the required module in your project.
Here is an example package.json file:
{
"name": "my-app",
"version": "0.1.0",
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"react-dev-utils": "^12.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
}