node-gyp error while doing npm install

拥有回忆 提交于 2019-11-30 08:54:36

The reason this happens is that node-gyp evaluates the -pre part of node@0.11.8-pre as -1. The install then receives a 404 and fails.

gyp http GET http://nodejs.org/dist/v0.8.-1/node-v11.8.-1.tar.gz
gyp http 404 http://nodejs.org/dist/v0.8.-1/node-v11.8.-1.tar.gz

To solve this problem, use a stable release of Node.js. Otherwise, you need to have the Node source lying around, and use the --nodedir flag.

npm install --nodedir=/node/src/

You can read more about this issue here.

Himanshu sharma

I solved this by upgrading my version of node to a stable version (e.g. not a "pre" version - your version is 0.8.13-pre) with the following:

sudo npm install -g n # install node version manager "n"
sudo n stable # install the latest stable version of node
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!