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

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

比使用npm安装自耕农,grund-cli和凉亭:

sudo npm install -g yo grunt-cli bower

一切顺利,包括“[Yeoman Doctor]一切看起来都没问题!”在自耕农的安装结束时.

/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?

我真的不知道为什么它会丢失.所以在经过一系列测试之后,我决定创建一个符号链接.

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!

dawei

【声明】:淮南站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。