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

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

Closed
neonwired opened this issue Mar 6, 2017 · 43 comments

Comments

@neonwired
Copy link

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

npm version 4.1.2
node version 7.7.1

@gaearon
Copy link
Contributor

gaearon commented Mar 6, 2017

Can you post a complete console output?
Also could you please follow these diagnostic steps and report the result?

@Timer
Copy link
Contributor

Timer commented Mar 6, 2017

This diagnostic code is now in [email protected], if you could test the new version and provide the output, that'd be great!

npm install -g create-react-app@latest

@neonwired
Copy link
Author

Creating a new React app in /home/project-penguin.

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

npm WARN deprecated [email protected]: 💥 preset-latest accomplishes the same task as babel-preset-env. 🙏 Please install it with 'npm install babel-preset-env --save-dev'. '{ "presets": ["latest"] }' to '{ "presets": ["env"] }'. For more info, please check the docs: http://babeljs.io/docs/plugins/preset-env 👌. And let us know how you're liking Babel at @babeljs on 🐦
[ .....] \ extract:camel-case: verb gentlyRm don't care about conte
Aborting installation.
npm install --save --save-exact react react-dom react-scripts has failed.

@gaearon
Copy link
Contributor

gaearon commented Mar 7, 2017

Which OS are you using?
Have you tried using npm 3.x? It may be a new bug.


Note to self: we should probably salvage npm log instead of nuking the directory. We should just make sure it's possible to create app with the same name again, but npm log should stay so people can attach it to bug reports.

@neonwired
Copy link
Author

I can only replicate it on Ubuntu 16.04, my other stacks using 14.04 seem ok.

@gaearon
Copy link
Contributor

gaearon commented Mar 7, 2017

This looks like an npm bug so I recommend trying different npm versions.

@ripplesphere
Copy link

Had same issue on a basic Digital Ocean server. Creating some swap space seems to fix the issue. See:
https://www.davidmeents.com/blog/how-to-simply-deploy-a-react-app-on-digital-ocean/

@gaearon
Copy link
Contributor

gaearon commented Mar 8, 2017

@ripplesphere Can you post the whole output of the command when it fails? It would be helpful so we can figure out how to better explain the problem in the CLI itself. I don't think #1735 (comment) shows the complete output.

@ripplesphere
Copy link

@gaearon Sorry. I fixed the problem and closed the terminal. The 'create-react-app hello-world' command would run for a while and then be "killed". It would happen at different locations in the process, which is why I suspected a resource issue.

@gaearon
Copy link
Contributor

gaearon commented Mar 8, 2017

Thanks. I guess there’s nothing actionable in this issue then.

@gaearon gaearon closed this as completed Mar 8, 2017
@viankakrisna
Copy link
Contributor

@gaearon Is it worth it to find the cause of memory issue? Seems that it's alienating for people with low resources. Or we should add a minimum memory requirements in the read me. I have also experienced create-react-app killed because of the memory while working in c9. Since then, I'm working locally for create-react-app.

@gaearon
Copy link
Contributor

gaearon commented Mar 8, 2017

We can't make npm consume less memory. I don't see a solution here.

@viankakrisna
Copy link
Contributor

hmm, in my case it's killed while running the devServer. It's happening a long time a go. Will open another issue when I can make a reproducible case.

@gaearon
Copy link
Contributor

gaearon commented Mar 8, 2017

Yes, but that's not what this particular issue was about (it was about npm).
We mention it in the docs for build: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-silently-fails.
Maybe we should make that entry more generic.

@viankakrisna
Copy link
Contributor

Thanks for the link, yeah I think we can add this npm (or any memory related ) issue in the read me.

@TheBlusky
Copy link

I had exactly the same issue !
I tried to uninstall node, npm, create-react-app many times...
Finally, I ended up modifying the "index.js" file of create-react-app script with the following :

Before:

      return install(useYarn, allDependencies, verbose, isOnline).then(function() {
        return packageName;
      });

After:

      return install(useYarn, allDependencies, verbose, isOnline).then(function() {
        return packageName;
      }).catch(function() {return packageName;});

This is a really dirty hack, but it worked fine.

@gaearon
Copy link
Contributor

gaearon commented Mar 16, 2017

Can you post the error message you got? It’s cool that you caught the error but it would be more useful to know what error it was so that we can fix it 😄

@TheBlusky
Copy link

My bad :-) I was so glad to finally be able to create a React App I didn't go further.
The error message is: { command: 'npm install --save --save-exact react react-dom react-scripts' }.
I think it's an NPM issue, packages are well installed, but NPM exit without a success behavior.

@gaearon
Copy link
Contributor

gaearon commented Mar 16, 2017

Oh I see. In this case this should have been printed.

We should keep the logs in such cases. It might have worked for you but it's still unsafe (e.g. likely to produce broken installs).

@TheBlusky
Copy link

TheBlusky commented Mar 16, 2017

Yes, that's why I said it is a "really dirty" hack. In fact, I tested the npm install --save --save-exact react react-dom react-scripts command manually. It exited promptly but was able to check whether or not packages were installed.

I wouldn't advise to implement my workaround, but it may be useful if someone is brave enough to try it manually :-)

@monsterooo
Copy link

Restart my computer, it works~ try ~

@lxcid
Copy link

lxcid commented Mar 28, 2017

In my case, it was unsafe-perm=false in ~/.npmrc causing some permissions issue.

86272 error Darwin 16.5.0
86273 error argv "/usr/local/Cellar/node/7.7.4/bin/node" "/usr/local/bin/npm" "install" "--save" "--save-exact" "react" "react-dom" "react-scripts"
86274 error node v7.7.4
86275 error npm  v4.1.2
86276 error code EPERM
86277 error errno EPERM
86278 error syscall spawn
86279 error Error: spawn EPERM
86279 error     at exports._errnoException (util.js:1034:11)
86279 error     at ChildProcess.spawn (internal/child_process.js:319:11)
86279 error     at exports.spawn (child_process.js:378:9)
86279 error     at spawn (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:21:13)
86279 error     at runCmd_ (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:271:14)
86279 error     at /usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:235:7
86279 error     at _combinedTickCallback (internal/process/next_tick.js:73:7)
86279 error     at process._tickCallback (internal/process/next_tick.js:104:9)
86279 error  { Error: spawn EPERM
86279 error     at exports._errnoException (util.js:1034:11)
86279 error     at ChildProcess.spawn (internal/child_process.js:319:11)
86279 error     at exports.spawn (child_process.js:378:9)
86279 error     at spawn (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:21:13)
86279 error     at runCmd_ (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:271:14)
86279 error     at /usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:235:7
86279 error     at _combinedTickCallback (internal/process/next_tick.js:73:7)
86279 error     at process._tickCallback (internal/process/next_tick.js:104:9) code: 'EPERM', errno: 'EPERM', syscall: 'spawn' }
86280 error Please try running this command again as root/Administrator.
86281 verbose exit [ 1, true ]

@astannard
Copy link

I had this issue and spent a long while trying to fix it, this is what worked for me. uninstalling and then reinstalling yarn. Then all worked fine, hope that helps someone

@codenoid
Copy link

codenoid commented Jun 5, 2017

same, ubuntu 16.04, node -v 7.10

@gaearon
Copy link
Contributor

gaearon commented Jun 5, 2017

If you have this issue it means npm is failing. Look at the log and hopefully you'll see why this happens. If not please raise a new issue with more information.

@rhalfi
Copy link

rhalfi commented Jun 20, 2017

for me fixed by running sudo chown -R $(whoami) "$HOME/.npm", after first making sure that upgraded to the latest stable version of npm (npm -g install npm).

@devdil
Copy link

devdil commented Jul 15, 2017

Updating node and npm fixed the issue for me @rhalfi 👍

@petardfoozer
Copy link

Had same issue on a basic Digital Ocean server. Creating some swap space seems to fix the issue. See:
https://www.davidmeents.com/blog/how-to-simply-deploy-a-react-app-on-digital-ocean/

This solved my problem. Seems the lower end Digital Ocean droplets don't have the required RAM to bring up the installation

@javaherian
Copy link

javaherian commented Sep 13, 2017

@ripplesphere @petardfoozer That link seems to be dead, but I think it's the correct solution.

Here is a cached version

http://webcache.googleusercontent.com/search?q=cache:https://www.davidmeents.com/blog/how-to-simply-deploy-a-react-app-on-digital-ocean/

@ahmadSaeedGoda
Copy link

Had same issue. Creating some swap space seems to fix the issue. thanks to https://github.com/ripplesphere

@pavsh
Copy link

pavsh commented Oct 18, 2017

had same issue. Creating some swap space seems to fix the issue. used this guide for adding 1GB swap:

@patrickdundas
Copy link

Creating swap space worked for me too!
@javaherian @ripplesphere @petardfoozer the link has moved to here https://www.davidmeents.com/?p=30

@nimrossum
Copy link

nimrossum commented Mar 29, 2018

I am experiencing this issue on windows. Updating npm doesn't fix it for me.
OS: Windows 10 Pro 64 bit
Node version: 8.9.4
NPM version: 5.8.0
CRA version: 1.5.2

I get the following output:

+ [email protected]
+ [email protected]
+ [email protected]
added 1327 packages from 785 contributors in 64.722s
npm verb exit [ 0, true ]
npm info ok

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

Deleting generated file... node_modules
Deleting generated file... package.json
Done.

@imagineLife
Copy link

imagineLife commented Jun 10, 2018

Hello! I have this same

JakesMBP:projects Jake$ create-react-app socket2client

Creating a new React app in /Users/Jake/Desktop/projects/socket2client.

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

npm ERR! asyncWrite is not a function
npm ERR! pna.nextTick is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Jake/.npm/_logs/2018-06-10T11_42_17_660Z-debug.log

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

Deleting generated file... package.json
Deleting socket2client / from /Users/Jake/Desktop/projects
Done.

I'm using npm 6.1.0
node 10.4

Is this still considered an NPM issue?
Thanks!

@bugzpodder
Copy link

Hi guys, I recommend filing a new issue if you run into a problem rather than commenting on a closed one

@iAfolayan
Copy link

npm ERR! Unexpected end of JSON input while parsing near '...s":"~1.5.0","mime":"1'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\JSTMI\AppData\Roaming\npm-cache_logs\2018-08-22T17_54_00_294Z-debug.log

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

Deleting generated file... package.json
Deleting message-app / from C:\reactjs
Done.

$ npm -v
6.4.0

$ node -v
v8.9.3

Windows 10

@raunak1
Copy link

raunak1 commented Sep 8, 2018

Hello guys i am facing some issue when i install react
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
can you please help me to describe actually what should i do

@pnecas
Copy link

pnecas commented Sep 25, 2018

Just uninstall yarn or re-install it may fix this.

@Lninn
Copy link

Lninn commented Oct 24, 2018

This diagnostic code is now in [email protected], if you could test the new version and provide the output, that'd be great!

npm install -g create-react-app@latest

Thanks!

@awakeel
Copy link

awakeel commented Oct 26, 2018

Same issue, I have tried all commands, but still not working

create-react-app users

Creating a new React app in C:\Users\Abdul Wakeel\Desktop\envato\users.

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

yarn add v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "8.9.4"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\Abdul Wakeel\Desktop\envato\users has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting users/ from C:\Users\Abdul Wakeel\Desktop\envato
Done.

@bugzpodder
Copy link

@awakeel as the error suggests, you should use a newer version of node. You are using 8.9.4, you should probably use 8.12.0 LTS.

@VenkatGupta31
Copy link

npm cache clean --force and ran create-react-app my-app solved the issue for me. Try it..

https://stackoverflow.com/questions/47180722/create-react-app-failing-to-create-a-new-react-app-in-windows-10/53047243#53047243

@codenoid
Copy link

unfollow this issue

@facebook facebook locked and limited conversation to collaborators Oct 29, 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