Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-react-app failing #1965

Closed
anilpank opened this issue Apr 10, 2017 · 29 comments
Closed

create-react-app failing #1965

anilpank opened this issue Apr 10, 2017 · 29 comments

Comments

@anilpank
Copy link

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’t 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’re 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.

@gaearon
Copy link
Contributor

gaearon commented Apr 10, 2017

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

@anilpank
Copy link
Author

1.3.0

@gaearon
Copy link
Contributor

gaearon commented Apr 10, 2017

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.

@anilpank
Copy link
Author

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

@gaearon
Copy link
Contributor

gaearon commented Apr 11, 2017

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.

@anilpank
Copy link
Author

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_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"})
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.

@gaearon
Copy link
Contributor

gaearon commented Apr 11, 2017

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?

@gaearon
Copy link
Contributor

gaearon commented Apr 11, 2017

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.

@anilreddykatta
Copy link
Contributor

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

gulpjs/gulp#1810

@Kaplaugher
Copy link

I have the exact same problem =(

@gaearon
Copy link
Contributor

gaearon commented Apr 23, 2017

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

It’s 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!

@SeducerStar
Copy link

SeducerStar commented May 13, 2017

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.

@viankakrisna
Copy link
Contributor

viankakrisna commented May 13, 2017

@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,

@SeducerStar
Copy link

@viankakrisna
yes! I use docker.

@viankakrisna
Copy link
Contributor

viankakrisna commented May 13, 2017

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.

@rickbeerendonk
Copy link
Contributor

@gaearon

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

create-react-app verbose exit code 1.txt

@the-spyke
Copy link

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.

@rickbeerendonk
Copy link
Contributor

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

@psteinroe
Copy link

psteinroe commented Jun 20, 2017

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?

@gaearon
Copy link
Contributor

gaearon commented Jun 30, 2017

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

@gaearon gaearon closed this as completed Jun 30, 2017
@guru9
Copy link

guru9 commented Dec 29, 2017

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.

@scalblog
Copy link

@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.

@kristifidani
Copy link

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

@Tzaphkiel
Copy link

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.

@Tzaphkiel
Copy link

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.

@gaearon
Copy link
Contributor

gaearon commented Jan 21, 2018

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

@evilbert82
Copy link

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

@shandude786
Copy link

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

@anilpank
Copy link
Author

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

@facebook facebook locked and limited conversation to collaborators Mar 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests