create-react-app failing

Created on 10 Apr 2017  路  29Comments  路  Source: facebook/create-react-app

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Many errors, especially related to "missing modules", are due to npm bugs.

If you're using Windows, follow these instructions to update npm.

If you're using OS X or Linux, run this to update npm:

npm install -g npm@latest

cd your_project_directory
rm -rf node_modules
npm install

Then try to reproduce the issue again.

Can you still reproduce it?
Yes

Description

I am trying to use create-react-app to create a react app using command create-react-app work. My OS is Windows 7 64 bit, npm version is 4.5.0, node version is v7.8.0, I tried with earlier npm and node versions as well and still unable to use create-react-app

What are you reporting?

Expected behavior

The command above should be able to create react app.
Tell us what you think should happen.

Actual behavior

Tell us what actually happens.
It aborts with following messages.
npm WARN prefer global [email protected] should be installed with -g
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
Aborting installation.
npm install --save --save-exact react react-dom react-scripts has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting work/ from C:\anil\business
Done.

Environment

Windows 7 64 bit
Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven鈥檛 ejected):
    C:\anil\business
    `-- (empty)
  2. node -v:
    v7.8.0

  3. npm -v:
    4.5.0

Then, specify:

  1. Operating system:
    Windows
  2. Browser and version:
    NA

    Reproducible Demo

Please take the time to create a new app that reproduces the issue.

Alternatively, you could copy your app that experiences the problem and start removing things until you鈥檙e left with the minimal reproducible demo.

(Accidentally, you might get to the root of your problem during that process.)

log.txt

Push to GitHub and paste the link here.

By doing this, you're helping the Create React App contributors a big time!
Demonstrable issues gets fixed faster.

bug

Most helpful comment

npm 5.x is very buggy at this moment. Please revert to npm 4.x in the meantime.

All 29 comments

Can you post output of create-react-app --version?

1.3.0

We made a mistake of deleting npm log files so we can't really tell what happened 馃槥

I think we should remove *.log files from this line and instead add them here. This way you'll have the log file remaining in the folder that would tell us what went wrong.

Can you try to do these changes to your local create-react-app (run which create-react-app to learn where it is) and then post npm-debug.log in the folder?

Sorry for the trouble.

I did the above changes and could not see any files generated. Looks like I have to finally learn webpack :(

Well, the issue is clearly with npm. Can you run

mkdir test
cd test
npm i react-scripts react react-dom

and post the output? I'd assume it would also fail.

I ran the above commands and did not see any error. A folder called node_modules was created with various modules and a .bin folder. I got the following warnings, but overall the operation was successful
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\react-scripts\node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open 'C:\anil\business\gargi\test\package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

Okay, thanks for trying.
Can you put a console.log before this line?

    child.on('close', function(code) {
      console.log(code); // <--- add this
      if (code !== 0) {
        reject({
          command: command + ' ' + args.join(' ')
        });
        return;
      }
      resolve();
    });

and try again?

Actually can I ask you to run create-react-app qwerty --verbose? I forgot we have this flag.
Then could you paste the output in a gist and link it from here.

@anilpank I guess issue is with fsevents, I have encountered same problem in windows while working on different package.

https://github.com/gulpjs/gulp/issues/1810

I have the exact same problem =(

I guess issue is with fsevents, I have encountered same problem in windows while working on different package.

It鈥檚 not an issue though. npm warns about an optional dependency, but it should not cause any errors. We have a continuous integration test that runs on Windows, and it works fine.

If you still have issues please run the command with --verbose flag as I asked earlier, and provide the output. Thanks!

I have the same problem. How can I fix this? node -v 7.10.0 npm -v 4.2.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm verb stack Error: EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/app/my-react/node_modules/.bin/acorn'
npm verb cwd /app/my-react
npm ERR! Linux 4.4.27-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "--save-exact" "react" "react-dom" "react-scripts" "--verbose"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! path ../acorn/bin/acorn
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/app/my-react/node_modules/.bin/acorn'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm verb exit [ -71, true ]

npm ERR! Please include the following file with any support request:
npm ERR! /root/.npm/_logs/2017-05-13T07_33_06_892Z-debug.log

Aborting installation.
npm install --save --save-exact react react-dom react-scripts --verbose has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting my-react/ from /app
Done.

@SeducerStar based on this

npm ERR! EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/app/my-react/node_modules/.bin/acorn'

npm fails to create a symlink for acorn. Do you run create-react-app in a linux vm for a shared folder in a windows host?

edit:
Looking at this

npm ERR! Linux 4.4.27-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "--save-exact" "react" 

it seems likely that it is.

try to run it with node in your host machine. AFAIK symlinking in a shared folder from windows will cause this Error: EPROTO: protocol error,

@viankakrisna
yes! I use docker.

yeah there's an issue with symlink and shared folder if your host is windows. I'm not aware any solution for this, so instead i just install and run node / npm / cra from the host machine.

I don't know if this issue also exists in linux / macOS though, because of the windows experience when i'm switching to mac i just install node and npm (and cra) on the host machine.

@gaearon

can I ask you to run create-react-app qwerty --verbose?

create-react-app verbose exit code 1.txt

I have the same issue. What is interesting, sometimes it completes successfully (especially when running with --verbose flag). node-gyp and fs-events are always pain.

There is a new fs-events release that might fix the issue on Windows. Let's see when create-react-app will use this: https://github.com/strongloop/fsevents/releases/tag/v1.1.2

I am having the same issue with fsevents! But for me it never works even with --verbose.
Running on Windows 10, npm @5.0.3, node @v6.11.0. Does anyone has a solution for that?

npm 5.x is very buggy at this moment. Please revert to npm 4.x in the meantime.

G:\GURU\WORK-BENCH\PROJECTS\ReactJS>create-react-app --version
1.4.3

G:\GURU\WORK-BENCH\PROJECTS\ReactJS>create-react-app my-app

-----------------------------------what is going on here ==unsolved==---------------------------

Creating a new React app in G:\GURU\WORK-BENCH\PROJECTS\ReactJS\my-app.

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 '...lugin-flowtype","dist'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bharat Moger\AppData\Roaming\npm-cache_logs\2017-12-29T10_13_00_967Z-debug.log

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting my-app / from G:\GURU\WORK-BENCH\PROJECTS\ReactJS
Done.

@guru9
I think I had the same problem. I did this command line

npm i -g npm@latest

and then

create-react-app my-app
worked.

C:\Users\krist\Desktop
位 create-react-app my-app

Creating a new React app in C:\Users\krist\Desktop\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for pinkie-promise

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\krist\AppData\Roaming\npm-cache_logs\2018-01-06T20_45_19_927Z-debug.log

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... package.json
Deleting my-app / from C:\Users\krist\Desktop
Done.

C:\Users\krist\Desktop
位 npm -v
5.6.0

C:\Users\krist\Desktop
位 node -v
v8.9.4

Windows host, Virtualbox running arch linux and the following versions:

$ npm -v
5.6.0
$ node -v
v9.4.0
$ create-react-app --version
1.5.1

If I use the create-react-app in the vm on the vm filesystem, there is no problems.
When I do the same on a vboxfs mounted share (still in linux), I actually get the following error:

npm ERR! code EROFS
npm ERR! errno -30
npm ERR! syscall symlink
npm ERR! rofs EROFS: read-only file system, symlink '../acorn/bin/acorn' -> '/mnt/share/web/mqtt-react-app/node_modules/.bin/acorn'
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/xywxywxyw/.npm/_logs/2018-01-21T20_26_38_569Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... node_modules
(node:682) UnhandledPromiseRejectionWarning: Error: ENOTEMPTY: directory not empty, rmdir '/mnt/share/web/mqtt-react-app/node_modules/ansi-align/node_modules'
    at Object.fs.rmdirSync (fs.js:866:18)
    at rmkidsSync (/usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:300:11)
    at rmdirSync (/usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:289:7)
    at rimrafSync (/usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:254:7)
    at /usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:298:5
    at Array.forEach (<anonymous>)
    at rmkidsSync (/usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:297:26)
    at rmdirSync (/usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:289:7)
    at rimrafSync (/usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:254:7)
    at /usr/lib/node_modules/create-react-app/node_modules/fs-extra/lib/remove/rimraf.js:298:5
(node:682) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:682) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

If I try a symlink or an rm -rf manually, it actually works... So I'm confused why the mounted share (virtualbox) makes it fail like this.

On windows it is not resolvable it seems.
I also made a mistake in saying that the symlinking works manually, it does not.

ref:

I could not get it to work.

We can't do much here; we just delegate to npm. If it fails, it fails.
You can try Yarn maybe.

I had the same problem running on Virtual Linux Machine. The host ran out of memory. Bumped up the RAM and it worked.

use create-react-app projectname --save
or create-react-app projectname --save-exact and start again

I switched to next.js and my problem is solved now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rdamian3 picture rdamian3  路  3Comments

Aranir picture Aranir  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments