Trouble generating a new project ember cli



I had the issue of only being able to install anything with npm using sudo on mac osx. So I removed everything and reinstalled using nvm following this guide:

Everything works fine. I can now install ember-cli, bower and phantomJS without sudo and with no errors.

When I go to generate a new project though using ember new project , It generates the file structure and then throws this error:

create vendor/.gitkeep
EACCES, mkdir '/Users/alex/.npm/qs/2.3.2'
 mkdir '/Users/alex/.npm/qs/2.3.2'
    at Error (native)

I’m a bit stumped. I think it’s a permissions problem but have googled around and can’t seem to find a solution. Wondering if someone could help me please?



Ah ok, this worked:

sudo chown -R $USER:$GROUP ~/.npm