可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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: