10

I tried to npm install jquery and it failed when trying to install one of it's dependencies, Contextify. So I tried to npm install contextify and got this error. I haven't been able to find a solution after about an hour or so of looking online. I keep getting close but not close enough. My node.js is running on Ubuntu 12.04, and as you can see in my code, node.js is version 0.8.11. Here is the error when trying to 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

And the error for npm install contextify:

npm ERR! contextify@0.1.3 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1

Any help is greatly appreciated. :)

UPDATE

I've read that problems come if python is not installed or if a gcc compiler is not installed. I have both of those installed. I followed these instructions for the gcc compiler, and python 2.7 comes with Ubuntu 12.04. So I'm still researching. :)

4

2 回答 2

2

你试过npm install --verbose contextify 2>&1 | grep gyp吗?它应该为您提供有关失败的详细输出。

于 2013-03-16T19:22:39.703 回答
0

我知道你提到安装了 python,但是这个python_path 呢?

如果这没有帮助:首先,您能否详细说明您在这台机器上安装 node.js 的方式?其次,为什么不用这么新版本的node.js呢?

于 2013-10-03T21:15:42.587 回答