create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Module Not Found : Cannot load 'react-scripts start' command.

Open ushnishdeybhowmik opened this issue 2 years ago • 2 comments

Describe the bug

After doing a clean installation of React using npx create-react-app my-app in my-app folder, the npm start command failed to initialize the development server and produced MODULE NOT FOUND error

'D\my-app\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'D:\Neil\Web Projects\Frontend\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:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Environment

Environment Info:

  current version of create-react-app: 5.0.1
  running from C:\Users\neilb\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22000.120.0), Chromium (103.0.1264.49)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    react-scripts: 5.0.1 => 5.0.1
  npmGlobalPackages:
    create-react-app: Not Found

Cannot seem to fix the issue please help!

ushnishdeybhowmik avatar Jul 29 '22 19:07 ushnishdeybhowmik

cd into the folder you want to create my-app then run this in your terminal npx create-react-app my-app cd my-app npm run start

this should work

dev-phantom avatar Aug 02 '22 04:08 dev-phantom

Just use the vite and run:

npm init vite Then, select the react template

Kenramiscal1106 avatar Aug 02 '22 05:08 Kenramiscal1106

Go to package.json file and under dependencies: re-write start as "start" : "node node_modules/react-scripts/bin/react-scripts start"

Then go to your terminal & run the command: npm run start

Allan2000-Git avatar Oct 04 '23 10:10 Allan2000-Git