我用chris lea的版本安装了nodejs:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
Run Code Online (Sandbox Code Playgroud)
比使用npm安装自耕农,grund-cli和凉亭:
sudo npm install -g yo grunt-cli bower
Run Code Online (Sandbox Code Playgroud)
一切顺利,包括"[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
Run Code Online (Sandbox Code Playgroud)
比我跑:
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
Run Code Online (Sandbox Code Playgroud)
什么地方出了错?我是否必须执行任何其他命令来正确安装yeoman?
Gab*_*lai 10
我真的不知道为什么它会丢失.所以在经过一系列测试之后,我决定创建一个符号链接.
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!
Run Code Online (Sandbox Code Playgroud)
从文档开始 yo
将安装bower
和grunt
. 你需要做的就是删除grunt
然后yo
重新安装yo
npm uninstall -g grunt yo
npm install -g yo
npm install -g yo
Run Code Online (Sandbox Code Playgroud)
如果您使用 npm 1.2.10 或更高版本,这也会自动为您安装 grunt 和 Bower。如果您使用的是旧版本的 npm,则需要手动安装它们
如果您过去已经全局安装了 Grunt,则需要先将其删除: npm uninstall -g grunt