Node.js 使用最新的nodejs 1.10.15安装yeoman

Node.js 使用最新的nodejs 1.10.15安装yeoman,node.js,ubuntu-13.10,Node.js,Ubuntu 13.10,将我的系统从Ubuntu13.04迁移到13.10,我已经安装了UbuntuLogiteque提供的最新nodejs软件包(这是自动软件包安装程序的frech名称,不知道英文版是否相同…) 正在尝试使用以下命令安装yeoman: npm install -g yo 给我以下错误: npm http 200 https://registry.npmjs.org/is/-/is-0.2.7.tgz /usr/local/bin/yo -> /usr/local/lib/node_modul

将我的系统从Ubuntu13.04迁移到13.10,我已经安装了UbuntuLogiteque提供的最新nodejs软件包(这是自动软件包安装程序的frech名称,不知道英文版是否相同…)

正在尝试使用以下命令安装yeoman:

npm install -g yo
给我以下错误:

 npm http 200 https://registry.npmjs.org/is/-/is-0.2.7.tgz
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> yo@1.1.2 postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

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

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /var/www
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/npm-debug.log
npm ERR! not ok code 0
查看/usr/share/doc/nodejs/README.Debian:

The upstream name for the Node.js interpreter command is "node".
In Debian the interpreter command has been changed to "nodejs".

This was done to prevent a namespace collision: other commands use
the same name in their upstreams, such as ax25-node from the "node"
package.

Scripts calling Node.js as a shell command must be changed to instead
use the "nodejs" command.
因此,我的结论是,为了使用nodejs 1.10.15,yeoman脚本应该将其对“node”的调用更改为“nodejs”

由于我不知道如何改变它,我想知道: 1.是否还有另一个yeoman脚本可用于nodejs 1.10.15 2.如果我降级我的nodejs版本,安装脚本会工作吗(如果是,我如何安装nodejs的降级版本)

谢谢你的想法

部分解决:

ln -sf /usr/bin/nodejs /usr/bin/node

使安装脚本正常工作,但不知道该解决方案是否干净…

我认为这与我发布的解决方案可能有用的另一个问题非常相似。具体来说


基本上,克隆Yeoman repo并编辑
package.json
以删除对
doctor.js
的安装后调用。这不是一个理想的解决方案,但对我来说很有效。。有关详细信息,请参阅另一个线程中的我的答案。

要解决此问题,您需要安装包nodejs legacy

sudo apt-get install nodejs-legacy

检查您的语言和编码是否正确。在我的设置中,我首先必须安装
nodejs legacy
,并且必须另外将
LC\u ALL
更改为:

export LC_ALL=en_US.utf8

可能的副本可能的副本也为我工作!