yo angular generates files in wrong path ( home directory )

与世无争的帅哥 提交于 2019-12-03 05:10:30

Thanks to issue page at https://github.com/yeoman/generator-angular/issues/1037#issuecomment-83118093 the solutions was relatively easy.

After the command mkdir my-new-project && cd $_ I needed to create an empty .yo-rc.json file with {} as content to this folder.

Then I could start yo and all files are created in my my-new-project folder now.

In case anyone else stumbles on this. The reason will be that a .yo-rc.json file is in the "wrong" directory.

Delete it and all will be well.

This started happening to me after I ran yo from my home folder by mistake. Apparently I didn't clean up the generated files properly and left the ~/.yo-rc.json around. All you need to do is get rid of the .yo-rc.json in your home folder and run yo from your desired folder again.

Probably you have there .yo-rc.json file. You should delete all hidden files in home directory which yeoman created and it's should works.

you should try not to install node with sudo, that causes your troubles. Take one instruction out of this link to install your node for usual user Instructions and it should work.

I searched for .yo-rc.json file in the folder it wrongfully creates your project in, then showed all hidden files via "defaults write com.apple.finder AppleShowAllFiles YES" in terminal then reload Finder ( alt button + right click on finder icon) and deleted the hidden .yo-rc.json file and other hidden files that came with it. Then reloaded finder again after using the same command as above but replace YES by NO. That did it for me !

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