【问题标题】:Contextify install fails - "node: not found"Contextify 安装失败 - “节点:未找到”
【发布时间】:2014-06-15 22:18:14
【问题描述】:

我无法在我的系统上安装 Contextify。我正在运行 Ubuntu 14.04,node.js 版本 0.10.25,npm 版本 1.3.10,node-gyp 版本 0.10.10

我已经尝试过升级、重新启动、首先安装依赖项,一切。没有什么可以让它发挥作用。

~$ 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

> contextify@0.1.8 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

【问题讨论】:

    标签: node.js installation npm


    【解决方案1】:

    我遇到了同样的问题。显然 Debian 已将导致问题的命令 node 重命名为 nodejs。对我来说,安装 nodejs-legacy 解决了这个问题。

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

    详情请见https://github.com/voodootikigod/node-serialport/issues/301

    【讨论】:

    • 或者只是将节点符号链接到nodejs
    • 我们今天刚遇到这个问题,它与使用 root 运行安装命令的用户有关。在上面的示例中,您正在运行 **sudo** npm install -g contextify。尝试以普通用户npm install -g contextify 运行它。
    猜你喜欢
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    • 2018-04-21
    • 1970-01-01
    • 2022-06-18
    • 2022-07-21
    • 2020-07-28
    • 1970-01-01
    相关资源
    最近更新 更多