Yeoman angular generator install runs but generator doesn't appear in generator list

浪尽此生 提交于 2019-12-03 01:54:45

Strangely enough I fixed this very same problem by replacing

npm install -g generator-angular

with

npm install -G generator-angular

Note the capital G in the second command

I used this

npm remove -g yo generator-* yeoman-generator 
npm install -g yo generator-angular

and now everything works very well

I've seen this problem a bunch of times, there are some problems because of node path. What you can do to fix this is very simple. You just need to tell node what is going to be the folder for global packages and this folder needs to have the same permissions as the user.

return the node path

npm config get prefix

create a node folder that you can destroy whenever you want

mkdir -p ~/.node

tell node to use this folder

npm config set prefix ~/.node

then try again npm install -g yo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!