2

我正在尝试在 Ubuntu Server 12 上安装 libxmljs

我运行了以下命令

sudo npm install libxmljs

我收到以下错误。

npm http GET https://registry.npmjs.org/libxmljs
npm http 304 https://registry.npmjs.org/libxmljs
npm http GET https://registry.npmjs.org/bindings/1.1.1
npm http GET https://registry.npmjs.org/nan/1.1.2
npm http 304 https://registry.npmjs.org/nan/1.1.2
npm http 304 https://registry.npmjs.org/bindings/1.1.1

> libxmljs@0.10.0 install /home/xxx/node_modules/libxmljs
> 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-24-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/sysadmin/node_modules/libxmljs
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

请帮忙。

4

1 回答 1

3

我有一个类似的问题,可以解决它。在更新的版本中,二进制名称可能从 nodejs 更改为 node。

ln -s /usr/bin/nodejs /usr/local/bin/node

于 2015-02-12T12:08:17.693 回答