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:
create-react-app my-app107
cd my-app107
npm start
(Compiled successfully!)
npm install [email protected]
npm WARN gentlyRm not removing C:wfmy-app107node_modulesespreenode_modules.binacorn.cmd as it wasn't installed by C:wfmy-app107node_modulesespreenode_modulesacorn
npm WARN gentlyRm not removing C:wfmy-app107node_modulesespreenode_modules.binacorn as it wasn't installed by C:wfmy-app107node_modulesespreenode_modulesacorn
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! [email protected] 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:wfmy-app107node_modulesreact-scriptspackage.json
npm ERR! error in C:wfmy-app107node_modulesreact-scripts: ENOENT: no such file or directory, open 'C:wfmy-app107node_modulesreact-scriptspackage.json'
npm ERR! invalid: react-scripts C:wfmy-app107node_modulesreact-scripts
This is all is left:
npm@5
is still very buggy, I suggest you downgrade to [email protected]
for the time being.
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
There is indeed a known funky thing going on with upgrades where npm isn't recognizing globals as having been installed by it. @Timer's x-ref is right.
Hey guys if you are on windows i solved the problem by simply typing "npm install react-scripts -g "
@JosephMeli This is not a solution. You'll bump into bigger problems later on. Please don't do it.
"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.
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.
I am running into the same problem when running npm start
, my npm is 5.3.0
.
I tried installing npmc which is version 5.4.0-canary.1
.
I get the same error when running npmc start
.
I am astonished to see that there is no solution for this yet. Running the command react-scripts in Windows simply does not work unless the package is installed globally. @gaearon if you have a solution, do share, because as of right now there is no way that I know of to use react-scripts on Windows without installing it globally.
@computerex the solution is to try the latest version of npm@5, and if that doesn't work, downgrade to npm 4.
This is not a bug with react-scripts
.
@gaearon Why are you closing this issue? Suggesting @cr101 file the issue with npm does not mean the issue should be closed on this thread. No solution has been found and you offered no correlating/similar thread when you closed it.
Suggesting to downgrade npm versions isn't a solution. That's temporarily duck taping it.
@kelvanince1 this issue has been closed because it is out of our control, and to our knowledge has been fixed with the latest version of npm.
If you can reproduce this with [email protected]
, then please provide a detailed bug report and reproduction steps, and file it with npm. Filing an issue here does no one any good.
@Timer Filing an issue on here does do good. If, at the very least, it provides information on why the issue has arisen and who is responsible for it, that is still enough incentive to file an issue on here.
Closing the issue isn't helpful.
Issues shouldn't be closed on the basis that it is out of the users hands to fix it. No solution had been found, therefore, the issue should have remained open, regardless of who has control over the issue.
If you believe it has been fixed with the latest version of npm, that might be a pretty decent incentive to specify the solution, and then close the issue.
@Timer Just an FYI, I can still reproduce this in 5.4.2.
mali@MOBILE-010520 C:\github\kanapaha\src\client\web
$ react-scripts start
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
mali@MOBILE-010520 C:\github\kanapaha\src\client\web
$ npm --version
5.4.2
mali@MOBILE-010520 C:\github\kanapaha\src\client\web
$ npm ls react-scripts
C:\github\kanapaha\src\client\web
`-- [email protected]
mali@MOBILE-010520 C:\github\kanapaha\src\client\web
@Timer Doesn't work with npm 4.6.1 either. I think maybe you guys should consider editing this apparently false statement:
Create React App works on macOS, **Windows**, and Linux.
If something doesn鈥檛 work please file an issue.
C:\github\kanapaha\src\client\web>npm --version
4.6.1
C:\github\kanapaha\src\client\web>npm ls react-scripts
C:\github\kanapaha\src\client\web
`-- [email protected]
C:\github\kanapaha\src\client\web>react-scripts start
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
I'm currently on a Windows machine, and this works just fine for me using both [email protected]
and [email protected]
, 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
I tried npm update
. Then react-scripts
would get updated. And problem fixed.
reinstall npm modules
npm install
the
run your script
@qianch3n thank you very much .. it worked also me.
npm update
Most helpful comment
I tried
npm update
. Thenreact-scripts
would get updated. And problem fixed.