npm install -g yo 命令给出 ->呃!yo@1.1.0 安装后:`节点脚本/doctor.js` [英] npm install -g yo command gives -> ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`
问题描述
我只是尝试进行 npm 安装,但最后收到关于医生、js 的错误.我需要担心吗?
I just tried to do a npm install but get this error about doctor,js at the end. Do I need to worry about it?
npm install -g yo
..
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/fstream/-/fstream-0.1.25.tgz
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js
> yo@1.1.0 postinstall /usr/local/lib/node_modules/yo
> node scripts/doctor.js
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.0 postinstall: `node scripts/doctor.js`
npm ERR! `sh "-c" "node scripts/doctor.js"` failed with 1
npm ERR!
npm ERR! Failed at the yo@1.1.0 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.js
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-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /etc/libvirt/qemu
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! /etc/libvirt/qemu/npm-debug.log
npm ERR! not ok code 0
EDIT____________--
EDIT____________--
出于某种原因,node -v 在终端中什么都不输出
for some reason node -v outputs nothing in terminal
我安装了最新的节点:
WebstormProjects # sudo apt-get 安装节点阅读包裹清单...完成构建依赖树读取状态信息...完成node 已经是最新版本了.0 升级,0 新安装,0 删除,143 未升级.
WebstormProjects # sudo apt-get install node Reading package lists... Done Building dependency tree Reading state information... Done node is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 143 not upgraded.
推荐答案
此链接中的解决方案对我有用:
The solution at this link has worked for me:
http://plaidzooks.tumblr.com/post/36894116867/using-node-js-on-debian-ubuntu-systems
Ubuntu 附带一个自动创建链接的包,因此只有通过创建链接才能将命令nodejs"作为节点"调用.
Ubuntu comes with a package that automatically creates a link so the command 'nodejs' can be invoked as 'node' only by creating a link.
sudo apt-get install nodejs-legacy
这让 Yeoman 工作起来.
And that got Yeoman working.
这篇关于npm install -g yo 命令给出 ->呃!yo@1.1.0 安装后:`节点脚本/doctor.js`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!