安装NW.js

时间:2016-02-06 00:33:29

标签: node.js npm nw.js

我在安装NW.js时遇到了一些问题。当我运行npm install nw时,我收到以下错误消息:

> nw@0.12.3 postinstall /root/node_modules/nw
> node scripts/install.js

sh: 1: node: not found
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! nw@0.12.3 postinstall: `node scripts/install.js`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the nw@0.12.3 postinstall script.
npm ERR! This is most likely a problem with the nw package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls nw
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.3.0-kali1-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "nw"
npm ERR! cwd /root
npm ERR! node -v v4.2.6
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0

我很确定这个问题与第一节讨论正在安装的node有关。我知道Debian存在一个问题,其中node包实际上已被采用,因此他们使用nodejs代替。我还不知道如何修复它,我已经尝试运行export node=nodejs并将其添加到~/.bashrc。有没有人对我能做什么有任何想法?我也遇到过其他npm软件包的问题。

1 个答案:

答案 0 :(得分:0)

  1. nodejs可执行文件称为节点,而不是nodejs。所以,只需删除您添加的行。 (export node=nodejs
  2. 如果它仍然无法工作:尝试通过包管理重新安装节点(apt-get / yum / dnf)或尝试从网站(https://nodejs.org/en/download/)重新安装可执行文件并设置PATH。