【问题标题】:Contextify@0.1.3 install: `node-gyp rebuild` failed with 1Contextify@0.1.3 安装:`node-gyp rebuild` 失败,结果为 1
【发布时间】: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。所以我还在研究。 :)

【问题讨论】:

标签: node.js npm node-gyp


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 2014-11-29
      • 2023-04-09
      • 2014-07-14
      • 1970-01-01
      • 2020-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-12
      相关资源
      最近更新 更多