Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install npm without sudo

I have to install npm on a computer that doesn't have root privileges, I will have a number of errors due to missing dependencies. I attach the screen. Any idea? Thanks.

enter image description here

enter image description hereenter image description here

like image 466
Francy Grillo Avatar asked May 20 '26 08:05

Francy Grillo


1 Answers

From isaacs, one of the contributors of node.js:

   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
    curl https://www.npmjs.org/install.sh | sh

For more informations: https://gist.github.com/isaacs/579814

like image 161
Jean-Baptiste Louazel Avatar answered May 24 '26 00:05

Jean-Baptiste Louazel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!