Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yo angular generates files in wrong path ( home directory )

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.

like image 858
svenhornberg Avatar asked Feb 12 '15 15:02

svenhornberg


1 Answers

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.

like image 192
svenhornberg Avatar answered Oct 11 '22 10:10

svenhornberg