Contextify@0.1.3安装:`node-gyp rebuild`失败,错误代码为1。

11

我尝试使用 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编译器,则会出现问题。我已安装了这两个。我按照这些关于gcc编译器的说明进行操作,并且Ubuntu 12.04附带了Python 2.7。所以我还在继续研究。:)


你可能遇到了与此类似的问题:http://stackoverflow.com/questions/9382868/unable-to-install-jquery-with-node-js-unable-to-load-contextify - Shane Chin
2个回答

2

你尝试过执行 npm install --verbose contextify 2>&1 | grep gyp 吗?它会给你提供详细的输出信息,帮助你找到失败的原因。


0

我知道你提到了Python已经安装了,但是python_path呢?

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接