0

I have read this thread npm / yeoman install generator-angular without sudo and resolve the permissions problem with the first way described here https://gist.github.com/isaacs/579814

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh

So now it works for some generators but it doesn't work for the generator-webapp I still getting permissions error for that one probably because I have installed it before with sudo. How can I overcome this problem and maybe someone can describe on the answer what have I done with the above commands.

Community
  • 1
  • 1
Petran
  • 7,677
  • 22
  • 65
  • 104

1 Answers1

0

The gist you link is incredibly old, it wants you to compile node with a custom prefix. After npm's inclusion in node I believe the last suggestion from that gist is the best option (and possibly only). It's also the one recommended in the SO question you link.

To summarize,

  • Undo everything you have so far.
  • Install node, preferably with a package manager instead of from source
  • Set a local npm directory with echo prefix = ${HOME}/.node >> ${HOME}/.npmrc
  • Add the bin folder under prefix to your path like you have done in .bashrc
Community
  • 1
  • 1
kalhartt
  • 3,999
  • 20
  • 25