Shahin Mahmud
Shahin Mahmud

Reputation: 91

npm start throws a error : internal/modules/cjs/loader.js:1032 throw err

npm start, npm test, npm run and npm build all throws this error, also when I have created a backend with node where I have try to use nodemon and add script start nodemon index.js. Then I run command npm start this also throws error. https://i.sstatic.net/YVk92.png

PS F:\all_js_works\Net Ninja Graphql with Node & React\client> npm start

> [email protected] start F:\all_js_works\Net Ninja Graphql with Node & React\client
> react-scripts start

'React\client\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:1032
  throw err;
  ^

Error: Cannot find module 'F:\all_js_works\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-06-18T12_02_03_487Z-debug.log

Upvotes: 1

Views: 4259

Answers (1)

Matthias Reissner
Matthias Reissner

Reputation: 355

Remove your node modules directory and package-lock.json and try it again

rm -rf node_modules && rm package-lock.json && npm install

Upvotes: 1

Related Questions