2014-06-15 37 views
15

我无法使Contextify安装在我的系统上。我运行Ubuntu 14.04,node.js版本0.10.25,npm版本1.3.10,节点gyp版本0.10.10Contextify安装失败 - “node:not found”

我试过升级,重新启动,首先安装依赖项,一切。没有什么会让它起作用。

~$ sudo npm install -g contextify 
npm http GET https://registry.npmjs.org/contextify 
npm http 304 https://registry.npmjs.org/contextify 
npm http GET https://registry.npmjs.org/bindings 
npm http GET https://registry.npmjs.org/nan 
npm http 304 https://registry.npmjs.org/bindings 
npm http 304 https://registry.npmjs.org/nan 

> [email protected] install /usr/local/lib/node_modules/contextify 
> node-gyp rebuild 

/bin/sh: 1: node: not found 
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp 
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431: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.13.0-29-generic 
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild" 
gyp ERR! cwd /usr/local/lib/node_modules/contextify 
gyp ERR! node -v v0.10.25 
gyp ERR! node-gyp -v v0.10.10 
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node" 
npm WARN For further explanations, please read 
/usr/share/doc/nodejs/README.Debian 

npm ERR! weird error 1 
npm ERR! not ok code 0 

回答

40

我有同样的问题。显然,Debian已将命令node更名为nodejs,这导致了该问题。对我来说安装​​修复了这个问题。

sudo apt-get update && sudo apt-get install nodejs-legacy 

查看https://github.com/voodootikigod/node-serialport/issues/301了解详情。

+4

或者只是将节点symlinking到nodejs – PitaJ

+0

我们今天刚刚遇到了这个问题,它必须与用户使用root运行安装命令。在上面的示例中,您正在运行'** sudo ** npm install -g contextify'。尝试像普通用户'npm install -g contextify'那样运行它。 – slickplaid