ubuntu - 哟: command not found

标签 ubuntu npm yeoman

我用 chris lea 的版本安装了 nodejs:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm

然后使用 npm 安装了 yeoman、grund-cli 和 bower:

sudo npm install -g yo grunt-cli bower

一切顺利,包括“[Yeoman Doctor] 一切看起来都很好!”在 yeoman 安装结束时。

/home/gabriela/npm/bin/yo -> /home/gabriela/npm/lib/node_modules/yo/cli.js
> yo@1.1.2 postinstall /home/gabriela/npm/lib/node_modules/yo
> node ./scripts/doctor

比我跑:

gabriela@Gabriela-Ubuntu:~$ which node
/usr/bin/node
gabriela@Gabriela-Ubuntu:~$ which npm
/usr/bin/npm
gabriela@Gabriela-Ubuntu:~$ which bower
/usr/bin/bower
gabriela@Gabriela-Ubuntu:~$ which yo
gabriela@Gabriela-Ubuntu:~$ yo
yo: command not found
gabriela@Gabriela-Ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$JAVA_HOME:$JRE_HOME

出了什么问题?我是否必须执行任何其他命令才能正确安装 yeoman?

最佳答案

我真的不知道为什么它会丢失。因此,经过一系列测试后,我决定创建一个符号链接(symbolic link)。

gabriela@Gabriela-Ubuntu:/$ sudo ln -s /home/gabriela/npm/bin/yo /usr/bin/yo
gabriela@Gabriela-Ubuntu:/$ yo
[?] What would you like to do? (Use arrow keys)
‣ Run the Angular-bootstrap generator (0.4.1) 
  Update your generators 
  Install a generator 
  Find some help 
  Get me out of here!

关于ubuntu - 哟: command not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24026166/

相关文章:

linux - 笔记本电脑上 ubuntu 服务器上的 Apache 子域

node.js - NVM 管理 npm 全局安装包返回命令未找到

angularjs - ui-router 不渲染 View

angularjs - 如果我正在运行 grunt 本地服务器,Soundcloud redirect_uri 应该是什么?

node.js - Grunt 失败构建 "Arguments to path.join must be strings"错误

ubuntu - SIPp 注册场景

ubuntu - 如何编写每天午夜运行脚本的 cron?

node.js - npm 删除无关包

node.js - 脚本终止时 NodeJS 运行命令

node.js - 安装(回滚)到旧的 socket.IO 版本