Note from Maintainers
This is an npm bug. Please update npm:
npm i -g npm@latest.
After installing create-react-app version 0.5.0 and running the command to create a project I get the error below:
$ create-react-app tktswp
Creating a new React app in /Users/MyUser/Projects/tktswp.
Installing packages. This might take a couple minutes.
Installing react-scripts from npm...
> [email protected] install /Users/MyUser/Projects/tktswp/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/MyUser/Projects/tktswp/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> [email protected] install /Users/MyUser/Projects/tktswp/node_modules/react-scripts/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/MyUser/Projects/tktswp/node_modules/react-scripts/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
[email protected] /Users/MyUser/Projects/tktswp
βββ¬ [email protected]
β βββ¬ [email protected]
β β βββ¬ [email protected]
β β βββ¬ [email protected]
β β βββ¬ [email protected]
β β βββ [email protected]
β βββ¬ [email protected]
β βββ [email protected]
βββ¬ [email protected]
βββ¬ [email protected]
βββ¬ [email protected]
βββ¬ [email protected]
βββ [email protected]
npm WARN EBUNDLEOVERRIDE Replacing bundled react-scripts > babel-plugin-transform-es2015-unicode-regex with new installed version
Installing react and react-dom from npm...
[email protected] node_modules/react-scripts/node_modules/react-dev-utils/node_modules/object-assign -> node_modules/object-assign
[email protected] node_modules/react-scripts/node_modules/babel-plugin-transform-es2015-unicode-regex/node_modules/regexpu-core -> node_modules/react-scripts/node_modules/babel-preset-es2015/node_modules/regexpu-core
- babel-plugin-transform-es2015-unicode-regex node_modules/react-scripts/node_modules/babel-plugin-transform-es2015-unicode-regex
- [email protected] node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/jsesc
- [email protected] node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/regenerate
- [email protected] node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/regexpu-core
- [email protected] node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/regjsgen
- [email protected] node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/regjsparser
- [email protected] node_modules/react-scripts/node_modules/react-dev-utils/node_modules/pinkie
- [email protected] node_modules/react-scripts/node_modules/react-dev-utils/node_modules/pinkie-promise
[email protected] /Users/MyUser/Projects/tktswp
βββ¬ [email protected]
β βββ¬ [email protected]
β β βββ [email protected]
β β βββ [email protected]
β β βββ¬ [email protected]
β β β βββ¬ [email protected]
β β β β βββ¬ [email protected]
β β β β β βββ [email protected]
β β β β βββ [email protected]
β β β βββ [email protected]
β β βββ¬ [email protected]
β β β βββ [email protected]
β β βββ [email protected]
β βββ¬ [email protected]
β βββ [email protected]
βββ [email protected]
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "react" "react-dom" "--save"
npm ERR! node v5.4.0
npm ERR! npm v3.3.12
npm ERR! path /Users/MyUser/Projects/tktswp/node_modules/react-scripts/node_modules/babel-plugin-transform-es2015-unicode-regex/node_modules/regexpu-core
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/MyUser/Projects/tktswp/node_modules/react-scripts/node_modules/babel-plugin-transform-es2015-unicode-regex/node_modules/regexpu-core' -> '/Users/MyUser/Projects/tktswp/node_modules/react-scripts/node_modules/babel-preset-es2015/node_modules/regexpu-core'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/MyUser/Projects/tktswp/npm-debug.log
`npm install react react-dom --save` failed
Interesting. Does npm start work after this?
It runs the server it serves content to the browser but it shows this error message in the browser and in the terminal:
Failed to compile.
Error in ./src/index.js
Module build failed: Error: Cannot find module 'babel-plugin-transform-es2015-unicode-regex'
@ multi main
Can you update npm, delete node_modules and run npm install?
npm install -g npm@latest
rm -rf node_modules
npm install
So far, I canβt reproduce this with Node 6.6.0, npm 3.10.8, and a clean cache, so Iβm assuming this is an npm bug that got fixed, or a stale cache issue. I assume you donβt use a custom npm registry?
@gaearon after updating npm it worked.
I forgot to check which version I had.
I'm curious now and would be nice to put it here to have it documented
@lucasfeliciano I think you can see your previous npm version in the log above
...
npm ERR! node v5.4.0
npm ERR! npm v3.3.12
...
and yes CRA documentation haven't mentioned about npm required version yet..
Youβll need to have Node >= 4 on your machine.
We strongly recommend to use Node >= 6 and npm >= 3 for faster installation speed and better disk usage.
It's not that we require any particular version. Unfortunately it's that npm is somewhat buggy and it's hard to guess which versions affect us.
Had same issue with node v5.4.0 and npm v3.3.12 (maybe it could be useful for somebody)
Interesting. Seems like [email protected] is the problematic one.
Does anyone have this issue with other versions?
π [email protected] was problematic for me as well
I have [email protected] (w/ [email protected]) and I get this as well. npm run build does not work after this error (got "Module not found: Error: Cannot resolve module 'react' in /Users/dceddia/tmp/build-test/src").
Updating to [email protected] with [email protected] is working now.
If only somebody wrote a reliable npm client! π
Same issue with:
npm ERR! node v5.5.0
npm ERR! npm v3.3.12
@TonyStarkBy
This is not exactly unexpected given all other reports with 3.3.12 in this issue π .
There is nothing we can fix here as itβs an npm bug.
Please update npm to the most recent stable version.
please help me!!!
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...OCN7GeUttnzhlJ/iy3oU'
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersPrakashAppDataRoamingnpm-cache_logs2019-01-08T06_29_31_212Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting myrapp/ from C:
Done.
Most helpful comment
If only somebody wrote a reliable npm client! π