create-react-app: 'react-scripts' is not recognized as an internal or external command

Updated to NodeJS v8.0.0 which includes npm v5.0.0 on my Windows 10 machine.

I created a new app as detailed below:

Reproducible Demo

create-react-app my-app107 cd my-app107 npm start (Compiled successfully!) npm install bootstrap@v4.0.0-alpha.6

npm WARN gentlyRm not removing C:\wf\my-app107\node_modules\espree\node_modules.bin\acorn.cmd as it wasn’t installed by C:\wf\my-app107\node_modules\espree\node_modules\acorn npm WARN gentlyRm not removing C:\wf\my-app107\node_modules\espree\node_modules.bin\acorn as it wasn’t installed by C:\wf\my-app107\node_modules\espree\node_modules\acorn npm notice created a lockfile as package-lock.json. You should commit this file. added 3 packages and removed 957 packages in 33.996s

npm start

‘react-scripts’ is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! my-app107@0.1.0 start: react-scripts start npm ERR! Exit status 1

npm ls react-scripts

(react-scripts) invalid error: ENOENT: no such file or directory, open 'C:\wf\my-app107\node_modules\react-scripts\package.json

npm ERR! error in C:\wf\my-app107\node_modules\react-scripts: ENOENT: no such file or directory, open ‘C:\wf\my-app107\node_modules\react-scripts\package.json’ npm ERR! invalid: react-scripts C:\wf\my-app107\node_modules\react-scripts

This is all is left: screenshot_7

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (7 by maintainers)

Most upvoted comments

I tried npm update. Then react-scripts would get updated. And problem fixed.

Hey guys if you are on windows i solved the problem by simply typing "npm install react-scripts -g "

Note from maintainers: this will break other things. Don’t do it.

I’m currently on a Windows machine, and this works just fine for me using both npm@5.4.2 and npm@4.6.1, so I advise you please open a detailed bug report with npm.

If you do not, this issue may never be fixed.

You may also try Yarn in the mean time, but we’re unable to deduce what’s unique about your machine.

$ npm install -g create-react-app yarn
$ create-react-app test-project

p.s. this should already be fixed in the latest npm canary, which will be available as npm@latest probably next Wednesday. You can use the canary for now by doing npm i -g npmc@latest and using the npmc binary instead of npm. Cheers.

Please file an issue with npm. You are describing behavior of npm (which appears to have a bug). This is not something we have control over. You can try downgrading npm to 4.x or use Yarn until this gets fixed.

cc @zkat

"npm install react-scripts -g " . @gaearon is right.

“-g” anywhere is not recommended. it installs the script globally and affects other repo’s project as well. stay away from it. i wasted a day troubleshooting that issue.