npm ERR! code ELIFECYCLE

匿名 (未验证) 提交于 2019-12-03 01:49:02

问题:

I'm trying to learn react, so I have this sample code for the fullstack react voting app, and I am trying to get it work but after running npm install followed by npm start I receive the following error:

Here is my package.json:

And finally my log file:

Thanks all you awesome programmers.

回答1:

Change access in node_modules directory



回答2:

I resolve this error running npm run clean (clean npm) then delete node_modules directory from my project structure. After That install dependencies again using npm install

Hope this help.



回答3:

workaround: Remove the lock file.

source: https://github.com/mapbox/node-pre-gyp/issues/298 (floriantraber)



回答4:



回答5:

Try to reinstall the cli package globally. In my case, I was trying to test a Vue.js tutorial when I get the same error message. The other thing I did was run the vue command again but this time using webpack-simple and that is why I am not sure wich one solved the problem but now it is working.



回答6:

I was getting similar error messages on a 16.04 Ubuntu instance with DigitalOcean while running npm run build on an app made with create-react-app (link). I upgraded the instance from 512MB RAM to 1GB ($5/mo to $10/mo) and then the script was able to run.

I post this here to point out that you may get this error due to resource limitations, which I didn't really see explained elsewhere on issue pages and SO answers. And nothing I saw in the error logs pointed me in this direction.



回答7:

Check for port availability as well if you encounter below message :



回答8:

run the command as superuser:



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!