Guys I am new to React and I get this same error every time I run the command npm start
. Can someone please help out because I am just stuck at this. Here is the error:
The system cannot find the path specified.
node:internal/modules/cjs/loader:942
throw err;
^
Error: Cannot find module 'C:\Users\Owner\Documents\react-scripts\bin\react-scripts.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
at Module._load (node:internal/modules/cjs/loader:780:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
CodePudding user response:
You can follow this command and it should work for me it worked!!
For All Operating => Windows, Linux, MacO
- Delete the node_modules directory
- Delete the package-lock.json file
- Run
npm install
If this command does not work try the below command - Run
npm install --save
- Run
npm start
For Linux
rm -rf node_modules package-lock.json && npm install && npm start
you can also read here about the similar error https://github.com/facebook/create-react-app/issues/9954
CodePudding user response:
it's becuase you must use npm install
first to install node_modules in your project and then run the app with npm start.