Node.js 安装NW.js

Node.js 安装NW.js,node.js,npm,nw.js,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 explanati

我在安装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存在一个问题,
节点
包实际上已经被占用,所以他们使用
nodejs
。我不知道如何修复它,我已经尝试运行
export node=nodejs
并将其添加到
~/.bashrc
。有人知道我能做什么吗?我在其他npm软件包中也遇到过这个问题

  • nodejs可执行文件称为node,而不是nodejs。所以,只需删除您添加的行。(
    导出节点=nodejs
  • 如果仍然无法运行:请尝试通过包管理(apt-get/yum/dnf)重新安装节点,或尝试从网站()重新安装可执行文件和安装路径

  • 谢谢你的回答,我直到现在才看到。debian上的可执行文件名为nodejs,因为另一个名为node的冲突包。我最终通过使用
    ln-s/usr/bin/nodejs/usr/bin/node
    对node和nodejs进行符号链接解决了这个问题。不,如果它没有自动为您进行符号链接。您必须已安装包节点。(在ubuntu上也一样)因此,卸载包节点,然后重新安装包节点将使其工作。