node.jsreactjsreact-scripts

React MODULE_NOT_FOUND error even if it should be correct


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.


Solution

  • I found what was problem for me. Actually my folder structure was going like this: Web Dev & Programming => Udemy ReacJS => -First React Big Project => senbonzakura-food

    And this "&" in the "Web Dev & Progamming" was making the probelm.