create-react-app: 'react-scripts' is not recognized as an internal or external command
Is this a bug report?
Yes
I have cleared both node_modules and package-lock.json via Powershell.
After npm install -g npm@latest npm -v 6.9.0
After npm install && npm start ‘react-scripts’ is not recognized as an internal or external command…
Which terms did you search for in User Guide?
Troubleshoot, create-react-app, react-scripts, “not recognized as an internal or external command”, npm scripts
Environment
npx create-react-app --info npx: installed 63 in 14.404s
Environment Info:
System: OS: Windows 10 CPU: x64 Intel® Core™ i7-6600U CPU @ 2.60GHz Binaries: npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.17763.1.0 Internet Explorer: 11.0.17763.1 npmPackages: react: ^16.8.4 => 16.8.4 react-dom: ^16.8.4 => 16.8.4 react-scripts: 2.1.8 => 2.1.8 npmGlobalPackages: create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
- cd C:\Users\notMyUsername\Documents\Project\react\
- npx create-react-app test
- cd test
- npm start
Expected Behavior
It is expected that the development server should launch through the default browser (firefox) on port 3000.
Actual Behavior
‘react-scripts’ is not recognized as an internal or external command, operable program or batch file.
2019-03-08T21_07_52_062Z-debug.log
Reproducible Demo
I don’t have project code yet because I can’t get the project to launch 😦 Strangely enough, I have another React project that was created with create-react-app ~6 months ago in the same parent directory as the test project and I don’t have any problems with it.
UPDATE After hitting this post https://github.com/facebook/create-react-app/issues/6197 the OP mentioned that running npx react-scripts start was able to start the development server. This is true for me as well, if this is any help for others. Still no luck with npm start. I have also tried this procedure with yarn and get the same results 😦
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 25 (3 by maintainers)
@ianHunterClipd Try using
npm i -g react-scripts
I was having the same error and was fixed might fix your problem tooi ran into similar problem on windows 10 with cygwin…
if i change package.json and add a ‘.cmd’ suffix to react-scripts references i no longer get the above error.
it looks like nodejs is confused about windows vs. cygwin vs. windows-bash… setting NODE_DEBUG=* indicates that PATH is being changed correctly internally but then windows cmd.exe is being used to run the command(react-scripts) but cannot find it…
further inspection of nodejs indicates questionable decision design for example node_modules/npm/lib/utils/is-windows-bash.js contains “process.env.TERM === ‘cygwin’”, which makes no sense as a way to detect cygwin, and is no longer valid for cygwin terminal emlation via mintty,
This fix worked for me. I’m not using cygwin, however, I am using WSL.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
thanks a lot, it was really helpful on my project.
Strange. Tried
npx react-scripts start
this morning and it still downloaded it even though it’s in the node_modules directory.@mitchbassProbus I suspect you are correct as I have a similar stack on my machine (Windows 10 + Windows Bash + Cygwin) but I haven’t explored the issue further. For development I have resorted to launching the react-scripts functionality from the local node_modules/.bin directory and haven’t had any snags.