Home > Mobile >  React MODULE_NOT_FOUND error even if it should be correct
React MODULE_NOT_FOUND error even if it should be correct

Time:06-07

recently I've been working with react. I had 4 days free and took a rest. Soon as I started again and tried to npm start it displayed error in terminal. Before that I cleared my desktop because it had a lot of folders and I moved that project in other folder. I thought that that might somehow cause the error and I've just tried with new npx create-react-app my-app. However this didn't fix error. It displays it on every single react project I have. I've been googling for 2 hours and tried everything although it didn't work. Can somebody please help.

Error:
The system cannot find the path specified. 
node:internal/modules/cjs/loader:936   
throw err;

Error: Cannot find module 'C:\Users\nijaz\Desktop\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778: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: []
}

Thank you for your time.

CodePudding user response:

Just Delete the node_modules directory, Delete the package-lock.json file and Run npm install, Run npm start.

try this:

rm -rf node_modules package-lock.json

Also: You Just need to make Sure that right address path for app.js (it should be app.js, main.js, start.js, server.js, or whatever you picked up) in out Package.json file. {"npm": .js} good luck

  • Related