【发布时间】:2013-10-04 05:15:42
【问题描述】:
我尝试npm install jquery,但在尝试安装其中一个依赖项 Contextify 时失败。所以我尝试npm install contextify 并得到了这个错误。在网上查找了大约一个小时左右后,我还没有找到解决方案。我不断靠近,但还不够靠近。我的 node.js 在 Ubuntu 12.04 上运行,正如您在我的代码中看到的,node.js 的版本是 0.8.11。这是尝试npm install jquery时的错误:
gyp http GET http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: socket hang up
gyp ERR! stack at createHangUpError (http.js:1263:15)
gyp ERR! stack at Socket.socketOnEnd (http.js:1351:23)
gyp ERR! stack at TCP.onread (net.js:418:26)
gyp ERR! System Linux 3.2.0-23-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/www/novacruisers/node_modules/jquery/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.8.11
gyp ERR! node-gyp -v v0.6.11
gyp ERR! not ok
npm WARN optional dep failed, continuing contextify@0.1.3
还有npm install contextify的错误:
npm ERR! contextify@0.1.3 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
非常感谢任何帮助。 :)
更新
我了解到,如果没有安装 python 或没有安装 gcc 编译器,就会出现问题。我已经安装了这两个。我关注these instructions for the gcc compiler,python 2.7 自带 Ubuntu 12.04。所以我还在研究。 :)
【问题讨论】:
-
您可能遇到与此相同的问题:stackoverflow.com/questions/9382868/…