【发布时间】:2014-05-28 00:27:55
【问题描述】:
我尝试安装 jsdom 这样的:
$ sudo npm install -g jsdom
# OR
$ sudo npm install jsdom
在一些成功的命令之后,安装很快就失败了,第一条错误消息在[....] 之后:
$ sudo npm install jsdom
npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/jsdom
[....]
> contextify@0.1.7 install /home/yug/Desktop/QGis/WikiAtlas/1_shaded_relief/test/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild
gyp: /home/yug/.node-gyp/0.10.25/common.gypi not found (cwd: /home/yug/Desktop/QGis/WikiAtlas/1_shaded_relief/test/node_modules/jsdom/node_modules/contextify) while reading includes of binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.8.0-35-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/yug/Desktop/QGis/WikiAtlas/1_shaded_relief/test/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/domhandler
npm http 304 https://registry.npmjs.org/domelementtype
npm ERR! contextify@0.1.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.7 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.0-35-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "jsdom"
npm ERR! cwd /home/yug/Desktop/QGis/WikiAtlas/1_shaded_relief/test
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/entities
....
提示?其他模块也会出现此错误:
$sudo npm install -g topojson
#bug with `contextify@0.1.7 install` error as well.
如何解决?
编辑:我尝试了sudo apt-get remove --purge nodejs npm topojson,然后通过各种方式重新安装。 即使nodejs 重新安装成功,错误仍然存在,所以我猜它是上下文相关的(node.gyp ?cwd ?...)。尝试删除/重新安装方式:
-
ubuntu_setup.sh
- 带有过时的原生网址
- 网址已更新为https://github.com/joyent/node.git,
-
sudo add-apt-repository ppa:chris-lea/node.js, - 手工制作
git clone https://github.com/joyent/node.git(试用已取消) - 使用various other ways:
- way1 : 正在进行中
【问题讨论】:
-
您好,您解决了这个问题吗?我也一样
-
不。投票赞成这个问题可能会增加它的知名度。
-
有趣的是,我现在似乎与
npm install -g topojson有同样的错误。 -
你试过重新安装nodejs吗?顺便说一句,我在 Windows 上尝试过,我得到了 ENOENT。
-
重新安装似乎不起作用,它[可能] 是别的东西,也许是
node-gyp。我很难理解错误消息编辑:请参阅问题,我添加了 O 所做的重新安装试验。
标签: node.js npm jsdom node-gyp contextify