yo angular generates the files in my home directory and I don't know why.
I did the following:
ppa for node
curl -sL https://deb.nodesource.com/setup | sudo bash -
then install node
sudo apt-get install -y nodejs
create a symlink
sudo ln -s "$(which nodejs)" /usr/bin/node
install yeoman
sudo npm install -g yo
sudo npm install -g generator-angular
next steps from the instruction from https://github.com/yeoman/generator-angular
mkdir my-new-project && cd $_
now I run
yo angular test1
now all the files will be created in my home directory instead of the my-new-project directory where I am currently. What did I wrong?
node -v: v0.10.36
npm -v: 2.5.1
Update1: new npm version
Solution:
yo angular looks for .yo-rc.json file in the current directory, if the file isnt there it tries to find it in the home dir. To solve this:
look for a hidden .yo-rc.json file in the home directory and delete it. Or create an empty .yo-rc.json file in the directory you want to use.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With