0

i used npx create-react-app basic and the react app was created. I then went into the basic folder and tried npm start but it gave me the following error:

npm start

basic@0.1.0 start C:\Users\91982\Desktop\html&css\React\basic
react-scripts start

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

Error: Cannot find module 'C:\Users\91982\Desktop\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! basic@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the basic@0.1.0 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\91982\AppData\Roaming\npm-cache\_logs\2020-06-10T19_54_37_385Z-debug.log

I even tried creating the app with npm but it gave me the same error. The start script is present in the json file. npm is updated to the latest version.

RobC
  • 22,977
  • 20
  • 73
  • 80
Varun Deokar
  • 21
  • 1
  • 5

6 Answers6

3

You can try the following:

  • cd to your project directory (Make sure there is a package.json file)
  • delete node_modules directory
  • npm install && npm start
asmaa
  • 715
  • 5
  • 15
3

try this

Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.

after restarting it will work 100%..

thanks

2
  1. npm install create-react-app -g
  2. cd you project folder
  3. delete node_modules folder
  4. npm install && npm start
MD. Sani Mia
  • 272
  • 1
  • 7
0

It appears you didn't install the dependencies. Run npm i or npm install to install the dependencies. It's not finding the react-scripts module because it wasn't installed.

Alex K
  • 832
  • 4
  • 8
  • Even though it said it installed the react-scripts module i installed it again anyway yet I got the same error. Can you please specify which dependancies do I need to install – Varun Deokar Jun 10 '20 at 20:51
0

I think it is an issue with your Windows PATH environment variable. It is trying to execute something in the local project node_modules directory, but windows cant find it because it is not in the path.

You can try using the npx command instead of npm.

npx start

Npx checks the PATH and local project binaries for executable.

D. Smith
  • 739
  • 5
  • 9
  • If you have npm version 5.2.0 and above npx should have been installed with it. You can also install it manually with `npm install -g npx`. Another option is to add your projects node_modules bin to your PATH. Mine looks like this: `C:\DSmith\vscode\projects\my-app\node_modules\.bin` – D. Smith Jun 10 '20 at 22:15
  • Same error even after adding the \.bin to path. I also tried adding react-scripts to path but it didn't work. npm and node are the latest versions. – Varun Deokar Jun 11 '20 at 06:59
0

I solved the issue. I had to add C:/Windows/Systen32 to my system variables Path. It started working after that.

Varun Deokar
  • 21
  • 1
  • 5