Francy Grillo
Francy Grillo

Reputation: 99

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

Upvotes: 3

Views: 5173

Answers (2)

Lijana Saniukaite
Lijana Saniukaite

Reputation: 1500

Fancy Install (Unix)

There's a pretty robust install script at https://www.npmjs.com/install.sh. You can download that and run it.

Here's an example using curl:

curl -L https://npmjs.com/install.sh | sh

Upvotes: 0

Jean-Baptiste Louazel
Jean-Baptiste Louazel

Reputation: 525

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

Upvotes: 3

Related Questions