fabian @ fabian-SATELLITE-C660:/ var / www / front-end / my-new-project $ yo angular 错误角度
您似乎没有一个名为angular的发电机。
您可以使用npm搜索yeoman-generator查看可用的生成器,然后使用npm install [name]安装它们。
要查看0个已注册的生成器,请使用--help
选项运行yo。
fabian @ fabian-SATELLITE-C660:/ var / www / front-end / my-new-project $
答案 0 :(得分:6)
哟医生是个好帮手:
fabian@fabian-SATELLITE-C660:/var/www/front-end/my-new-project$ yo doctor
[Yeoman Doctor] Uh oh, I found potential errors on your machine
[Error] NPM root value is not in your NODE_PATH [info] NODE_PATH = /usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript NPM root = /home/fabian/npm/lib/node_modules
[Fix] Append the NPM root value to your NODE_PATH variable Add this line to your .bashrc export NODE_PATH=$NODE_PATH:/home/fabian/npm/lib/node_modules Or run this command echo "export NODE_PATH=$NODE_PATH:/home/fabian/npm/lib/node_modules" >> ~/.bashrc > && source ~/.bashrc
fabian@fabian-SATELLITE-C660:/var/www/front-end/my-new-project$ echo "export >> NODE_PATH=$NODE_PATH:/home/fabian/npm/lib/node_modules" >> ~/.bashrc > && source ~/.bashrc
fabian@fabian-SATELLITE-C660:/var/www/front-end/my-new-project$ yo doctor [Yeoman Doctor] Everything looks alright!
现在一切正常:
fabian@fabian-SATELLITE-C660:/var/www/front-end/my-new-project$ yo angular
_-----_ | | .--------------------------. |--(o)--| | Welcome to Yeoman, | `---------´ | ladies and gentlemen! | ( _´U`_ ) '--------------------------' /___A___\ | ~ | __'.___.'__ ´ ` |° ´ Y `
开箱即用,我包括Bootstrap和一些AngularJS推荐的模块。
答案 1 :(得分:0)
可能你安装了sudo,所以:
sudo yo angular projectname