Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
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://www.npmjs.org/install.sh | sh
# this way is best if you want to stay up to date
# or submit patches to node or npm
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
# could also fork, and then clone your own fork instead of the official one
git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local
make install
cd ..
git clone git://github.com/isaacs/npm.git
cd npm
make install # or `make link` for bleeding edge
# take ownership of the folders that npm/node use
# please don't do this if you don't know what it does!
sudo mkdir -p /usr/local/{share/man,bin,lib/node,include/node}
sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
# now just a pretty vanilla node install
# let it use the default paths, but don't use sudo, since there's no need
mkdir node-install
curl http://nodejs.org/dist/node-v0.4.3.tar.gz | tar -xzf - -C node-install
cd node-install/*
./configure
make install
# now the npm easy-install
curl https://www.npmjs.org/install.sh | sh
# use nave, but without a subshell
# note that we're doing "usemain" instead of "use"
mkdir ~/.nave
cd ~/.nave
wget http://github.com/isaacs/nave/raw/master/nave.sh
sudo ln -s $PWD/nave.sh /usr/local/bin/nave
# take ownership
# please don't do this if you don't know what it does!
sudo mkdir -p /usr/local/{share/man,bin,lib/node,include/node}
sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
# install the latest stable nodejs in the "main" root.
nave usemain stable
curl https://www.npmjs.org/install.sh | sh
# this way is really handy if you want to test things
# in different versions of node and use stable release
# versions of things.
# make a folder where you want to keep this stuff.
mkdir ~/.nave
cd ~/.nave
wget http://github.com/isaacs/nave/raw/master/nave.sh
sudo ln -s $PWD/nave.sh /usr/local/bin/nave
# now you can forget about that folder.
# you never have to go back in there.
# to use a version of node in a virtual environment
nave use 0.4.8
# to install npm in that virtualenv
curl https://www.npmjs.org/install.sh | sh
# do stuff...
npm install whatever etc
# return to non-nave-land
exit
# use a different version of node..
nave use 0.4.6
# etc...
# using Homebrew
# Note: `brew install npm` has problems, as of 2010-12-30.
# hopefully it will eventually be good and happy.
# As of npm@0.2.13, however, this is an option
PREFIX=$(brew --prefix)
# take ownership
# this will also let homebrew work without using sudo
# please don't do this if you don't know what it does!
sudo mkdir -p $PREFIX/{share/man,bin,lib/node,include/node}
sudo chown -R $USER $PREFIX/{share/man,bin,lib/node,include/node}
brew install node
# now install npm
# prefix will default to $(brew --prefix)
curl https://www.npmjs.org/install.sh | sh
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
echo 'export npm_config_userconfig=$HOME/.config/npmrc' >> ~/.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
# install node wherever.
# use sudo even, it doesn't matter
# we're telling npm to install in a different place.
echo prefix = ~/local >> ~/.npmrc
curl https://www.npmjs.org/install.sh | sh
@DTrejo

This comment has been minimized.

Show comment
Hide comment
@DTrejo

DTrejo Oct 3, 2010

Used the top one, and it worked great. Thanks :)

DTrejo commented Oct 3, 2010

Used the top one, and it worked great. Thanks :)

@optikfluffel

This comment has been minimized.

Show comment
Hide comment
@optikfluffel

optikfluffel Oct 18, 2010

For me the 2nd one worked ^^ thx

optikfluffel commented Oct 18, 2010

For me the 2nd one worked ^^ thx

@joar

This comment has been minimized.

Show comment
Hide comment
@joar

joar Nov 12, 2010

First one worked perfectly, although on a Debian x64 512M RAM it did not perform in 30 seconds.

'install' finished successfully (3m23.933s)

HAH! NEVERMIND! Didn't work, > node works, > npm does not. I had created the ~/npm before i ran the script. I'll retry.

Edit: I retried after I cleaned up some node-related directories, binaries and installs. I uninstalled nodejs, the Aptitude(package manager) version of node from my machine and removed all node-related directories in ~.

The self-compiled node version created with the first script works perfectly :)

joar commented Nov 12, 2010

First one worked perfectly, although on a Debian x64 512M RAM it did not perform in 30 seconds.

'install' finished successfully (3m23.933s)

HAH! NEVERMIND! Didn't work, > node works, > npm does not. I had created the ~/npm before i ran the script. I'll retry.

Edit: I retried after I cleaned up some node-related directories, binaries and installs. I uninstalled nodejs, the Aptitude(package manager) version of node from my machine and removed all node-related directories in ~.

The self-compiled node version created with the first script works perfectly :)

@JeanNiBee

This comment has been minimized.

Show comment
Hide comment
@JeanNiBee

JeanNiBee Dec 5, 2010

First option worked well for me once I realize that the path of node is important. I.E. I had node previously installed to usr/local not my ~/local. I pushed my ~/local to have higher precedence in the path and the npm installation worked without a hitch.

Addendum: As I had 'system' node and a local node installed, when I borked up my paths and the system node was running, all my paths were screwed when doing requires in my code, forcing the local 'node' to be my executable fixed all my path issues.

Ex: 'which node' returns a path to my ~/jbateman/local installation instead of /usr/local/bin

JeanNiBee commented Dec 5, 2010

First option worked well for me once I realize that the path of node is important. I.E. I had node previously installed to usr/local not my ~/local. I pushed my ~/local to have higher precedence in the path and the npm installation worked without a hitch.

Addendum: As I had 'system' node and a local node installed, when I borked up my paths and the system node was running, all my paths were screwed when doing requires in my code, forcing the local 'node' to be my executable fixed all my path issues.

Ex: 'which node' returns a path to my ~/jbateman/local installation instead of /usr/local/bin

@thynctank

This comment has been minimized.

Show comment
Hide comment
@thynctank

thynctank Dec 13, 2010

seems like someone is keeping ports up to date as well...

thynctank commented Dec 13, 2010

seems like someone is keeping ports up to date as well...

@RobertStewart

This comment has been minimized.

Show comment
Hide comment
@RobertStewart

RobertStewart Dec 26, 2010

For the take-ownership script, you first need to create /usr/local/lib/node and /usr/local/include/node.

sudo mkdir -p /usr/local/{lib/node,include/node}

RobertStewart commented Dec 26, 2010

For the take-ownership script, you first need to create /usr/local/lib/node and /usr/local/include/node.

sudo mkdir -p /usr/local/{lib/node,include/node}
@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Dec 27, 2010

Thanks, Robert, good catch. Fixed.

Owner

isaacs commented Dec 27, 2010

Thanks, Robert, good catch. Fixed.

@ramwisc

This comment has been minimized.

Show comment
Hide comment
@ramwisc

ramwisc Jan 4, 2011

The 2nd script (only-git-all-the-way.sh) has a wrong URL for cloning node. It should read:

git clone https://github.com/ry/node.git

instead of

git clone git://github.com/ry/node.git

ramwisc commented Jan 4, 2011

The 2nd script (only-git-all-the-way.sh) has a wrong URL for cloning node. It should read:

git clone https://github.com/ry/node.git

instead of

git clone git://github.com/ry/node.git

@ramwisc

This comment has been minimized.

Show comment
Hide comment
@ramwisc

ramwisc Jan 4, 2011

ok..cool.

ramwisc commented Jan 4, 2011

ok..cool.

@chadams

This comment has been minimized.

Show comment
Hide comment
@chadams

chadams Jan 7, 2011

If your on a MAC remember your ".bashrc" isn't used, it should be ".bash_profile"

chadams commented Jan 7, 2011

If your on a MAC remember your ".bashrc" isn't used, it should be ".bash_profile"

@maxidr

This comment has been minimized.

Show comment
Hide comment
@maxidr

maxidr Jan 29, 2011

Thanks for share!! good work!

maxidr commented Jan 29, 2011

Thanks for share!! good work!

@rbotman

This comment has been minimized.

Show comment
Hide comment
@rbotman

rbotman Mar 11, 2011

For the only-git-all-the-way script, the location of node.git should be updated:
git://github.com/joyent/node.git

rbotman commented Mar 11, 2011

For the only-git-all-the-way script, the location of node.git should be updated:
git://github.com/joyent/node.git

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs
Owner

isaacs commented Mar 11, 2011

@rbotman: Thanks.

@TrevorBurnham

This comment has been minimized.

Show comment
Hide comment
@TrevorBurnham

TrevorBurnham Mar 22, 2011

There's a reference to node-v0.2.5.tar.gz that should be replaced with node-latest.tar.gz.

TrevorBurnham commented Mar 22, 2011

There's a reference to node-v0.2.5.tar.gz that should be replaced with node-latest.tar.gz.

@d2s

This comment has been minimized.

Show comment
Hide comment
@d2s

d2s Mar 26, 2011

There is one quite nasty error in only-git-all-the-way.sh example:

There should be
cd ~/local
before first git clone command so that things would end up to ~/local/node/ instead of ~/node/

d2s commented Mar 26, 2011

There is one quite nasty error in only-git-all-the-way.sh example:

There should be
cd ~/local
before first git clone command so that things would end up to ~/local/node/ instead of ~/node/

@DTrejo

This comment has been minimized.

Show comment
Hide comment
@DTrejo

DTrejo Mar 26, 2011

Re: https://gist.github.com/579814#file_take_ownership.sh

Just a note: make install does not work without sudo.

DTrejo commented Mar 26, 2011

Re: https://gist.github.com/579814#file_take_ownership.sh

Just a note: make install does not work without sudo.

@edlongman

This comment has been minimized.

Show comment
Hide comment
@edlongman

edlongman Mar 28, 2011

Help !!
whenever the command
curl http://npmjs.org/install.sh | sh
is run on my computer I just end up with a gzip process that runs forever
and advice because i'm really struggling

Also if I try the git all the way i get this
node cli.js install -g
npm ERR! Could not read data for npm@1.0.0rc8
npm ERR! error installing npm@1.0.0rc8 Error: ECONNREFUSED, Could not contact DN
S servers
npm ERR! error installing npm@1.0.0rc8 at IOWatcher.callback (dns.js:53:15)
npm ERR! Error: ECONNREFUSED, Could not contact DNS servers
npm ERR! at IOWatcher.callback (dns.js:53:15)
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System CYGWIN_NT-5.1 1.7.8(0.236/5/3)
npm ERR! command "node" "/home/NJH/node-latest-install/npm/cli.js" "install" "-g
"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/NJH/node-latest-install/npm/npm-debug.log
npm not ok

edlongman commented Mar 28, 2011

Help !!
whenever the command
curl http://npmjs.org/install.sh | sh
is run on my computer I just end up with a gzip process that runs forever
and advice because i'm really struggling

Also if I try the git all the way i get this
node cli.js install -g
npm ERR! Could not read data for npm@1.0.0rc8
npm ERR! error installing npm@1.0.0rc8 Error: ECONNREFUSED, Could not contact DN
S servers
npm ERR! error installing npm@1.0.0rc8 at IOWatcher.callback (dns.js:53:15)
npm ERR! Error: ECONNREFUSED, Could not contact DNS servers
npm ERR! at IOWatcher.callback (dns.js:53:15)
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System CYGWIN_NT-5.1 1.7.8(0.236/5/3)
npm ERR! command "node" "/home/NJH/node-latest-install/npm/cli.js" "install" "-g
"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/NJH/node-latest-install/npm/npm-debug.log
npm not ok

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Mar 28, 2011

Owner

isaacs commented Mar 28, 2011

@devlim

This comment has been minimized.

Show comment
Hide comment
@devlim

devlim Apr 14, 2011

May i know how to upgrade node.js? just run the same command again?

devlim commented Apr 14, 2011

May i know how to upgrade node.js? just run the same command again?

@DTrejo

This comment has been minimized.

Show comment
Hide comment
@DTrejo

DTrejo Apr 14, 2011

Hey devlim, try running one of these again, it should work (if you can remember, try to use the same one as last time, but either way it should work fine).

DTrejo commented Apr 14, 2011

Hey devlim, try running one of these again, it should work (if you can remember, try to use the same one as last time, but either way it should work fine).

@devlim

This comment has been minimized.

Show comment
Hide comment
@devlim

devlim Apr 14, 2011

Thank DTrejo.

devlim commented Apr 14, 2011

Thank DTrejo.

@brandondrew

This comment has been minimized.

Show comment
Hide comment
@brandondrew

brandondrew Apr 25, 2011

What is the rationale for installing to ~/local in so many of these?

brandondrew commented Apr 25, 2011

What is the rationale for installing to ~/local in so many of these?

@joar

This comment has been minimized.

Show comment
Hide comment
@joar

joar Apr 25, 2011

I think it is to separate node and the node related tools from the rest of the system. This is preferrable since NodeJS is in rapid development and is rarely or never available from the package manager in it's latest version.

Since it is separated from the global program installation folders, it's not as easily lost and forgotten, not so much for disk space, perhaps, but more for the principle.

joar commented Apr 25, 2011

I think it is to separate node and the node related tools from the rest of the system. This is preferrable since NodeJS is in rapid development and is rarely or never available from the package manager in it's latest version.

Since it is separated from the global program installation folders, it's not as easily lost and forgotten, not so much for disk space, perhaps, but more for the principle.

@isaacs

This comment has been minimized.

Show comment
Hide comment
Owner

isaacs commented Apr 25, 2011

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Apr 26, 2011

Owner

isaacs commented Apr 26, 2011

@vkelman

This comment has been minimized.

Show comment
Hide comment
@vkelman

vkelman May 3, 2011

I'm getting the same error as edlongman trying to run curl http://npmjs.org/install.sh | sh (Cygwin)

vkelman commented May 3, 2011

I'm getting the same error as edlongman trying to run curl http://npmjs.org/install.sh | sh (Cygwin)

@zachaysan

This comment has been minimized.

Show comment
Hide comment
@zachaysan

zachaysan May 5, 2011

Hey guys make sure that the last line of code in your bashrc file is not a comment as the appending will lead you to a commented out PATH=$HOME/local/bin:$PATH which means the install will fail.

zachaysan commented May 5, 2011

Hey guys make sure that the last line of code in your bashrc file is not a comment as the appending will lead you to a commented out PATH=$HOME/local/bin:$PATH which means the install will fail.

@zachaysan

This comment has been minimized.

Show comment
Hide comment
@zachaysan

zachaysan May 5, 2011

I updated the code at a fork of the gist here: https://gist.github.com/957346

If there is a way of doing a pull request for a gist I can't seem to find it.

zachaysan commented May 5, 2011

I updated the code at a fork of the gist here: https://gist.github.com/957346

If there is a way of doing a pull request for a gist I can't seem to find it.

@jtmkrueger

This comment has been minimized.

Show comment
Hide comment
@jtmkrueger

jtmkrueger May 6, 2011

When I did the install as superuser (take-ownership) route I got an error:
Could not install the file '/usr/local/lib/pkgconfig/nodejs.pc'

anyone have any ideas?

jtmkrueger commented May 6, 2011

When I did the install as superuser (take-ownership) route I got an error:
Could not install the file '/usr/local/lib/pkgconfig/nodejs.pc'

anyone have any ideas?

@iansheridan

This comment has been minimized.

Show comment
Hide comment
@iansheridan

iansheridan May 7, 2011

In referance to the second method "only_git_all_the_way.sh". I ran into a problem with installing npm. The way that I resolved the issue was to once my .bashrc file was updated (line 5), I added source ~/.bashrc to the script. This put node in the path and installing npm worked just fine.

iansheridan commented May 7, 2011

In referance to the second method "only_git_all_the_way.sh". I ran into a problem with installing npm. The way that I resolved the issue was to once my .bashrc file was updated (line 5), I added source ~/.bashrc to the script. This put node in the path and installing npm worked just fine.

@mccoy

This comment has been minimized.

Show comment
Hide comment
@mccoy

mccoy May 7, 2011

@jtmkrueger: the pkgconfig command is used by various build utilities to determine what you have installed on a system without needing to dig through output from various platform-specific package managers (e.g. build sequence needs to know where you have installed lua, so it looks for /usr/lib/pkgconfig/lua.pc, /usr/local/lib/pkgconfig/lua.pc, etc until it finds one and in that file there is a listing of where the various lib and bin dirs are for that package.) If this is the first major package you have installed in /usr/local then it is possible that the pkgconfig directory does not exist. Try running (as root/sudo) "mkdir /usr/local/lib/pkgconfig" and then install again.

mccoy commented May 7, 2011

@jtmkrueger: the pkgconfig command is used by various build utilities to determine what you have installed on a system without needing to dig through output from various platform-specific package managers (e.g. build sequence needs to know where you have installed lua, so it looks for /usr/lib/pkgconfig/lua.pc, /usr/local/lib/pkgconfig/lua.pc, etc until it finds one and in that file there is a listing of where the various lib and bin dirs are for that package.) If this is the first major package you have installed in /usr/local then it is possible that the pkgconfig directory does not exist. Try running (as root/sudo) "mkdir /usr/local/lib/pkgconfig" and then install again.

@jabowery

This comment has been minimized.

Show comment
Hide comment
@jabowery

jabowery May 26, 2011

Please fix only-git-all-the-way.sh as per the above comment.

jabowery commented May 26, 2011

Please fix only-git-all-the-way.sh as per the above comment.

@kevinSuttle

This comment has been minimized.

Show comment
Hide comment
@kevinSuttle

kevinSuttle Jul 1, 2011

First one worked! Woot! This should be the default. I had problems with it the first two times I tried.

kevinSuttle commented Jul 1, 2011

First one worked! Woot! This should be the default. I had problems with it the first two times I tried.

@rumkin

This comment has been minimized.

Show comment
Hide comment
@rumkin

rumkin Jul 4, 2011

Hi i've got such problem with npm on ubuntu 11.04:
packages and npm automatically installed in folder /proc/7278/cwd/...
And then node.js can't load any installed module. I used this bash script:

mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc

# could also fork, and then clone your own fork instead of the official one

git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local --without-ssl
make install
cd ..

git clone git://github.com/isaacs/npm.git
cd npm
make install

Maybe anyone could help me: what if i want to install node.js to /media/lazersluts/nodejs, what should i do.
And wich files i should to remove excepts ~/local and ~/.bashrc to completely remove node.js. If i want to make fresh installation.
Thanks. And sorry for noobies and "excellent English" )

Update

Solved with

echo prefix = ~/local >> ~/.npmrc
curl http://npmjs.org/install.sh | sh

rumkin commented Jul 4, 2011

Hi i've got such problem with npm on ubuntu 11.04:
packages and npm automatically installed in folder /proc/7278/cwd/...
And then node.js can't load any installed module. I used this bash script:

mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc

# could also fork, and then clone your own fork instead of the official one

git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local --without-ssl
make install
cd ..

git clone git://github.com/isaacs/npm.git
cd npm
make install

Maybe anyone could help me: what if i want to install node.js to /media/lazersluts/nodejs, what should i do.
And wich files i should to remove excepts ~/local and ~/.bashrc to completely remove node.js. If i want to make fresh installation.
Thanks. And sorry for noobies and "excellent English" )

Update

Solved with

echo prefix = ~/local >> ~/.npmrc
curl http://npmjs.org/install.sh | sh
@rumkin

This comment has been minimized.

Show comment
Hide comment
@rumkin

rumkin Jul 4, 2011

Why does

require('npm-name');

work only on partition where node.js installed? And doesn't on other partitions?

rumkin commented Jul 4, 2011

Why does

require('npm-name');

work only on partition where node.js installed? And doesn't on other partitions?

@pcambra

This comment has been minimized.

Show comment
Hide comment
@pcambra

pcambra Aug 6, 2011

I had to do sudo make install in the first solution.

Also I had problems with npm: http://stackoverflow.com/questions/6383413/npm-install-issues-ubuntu-11-04

pcambra commented Aug 6, 2011

I had to do sudo make install in the first solution.

Also I had problems with npm: http://stackoverflow.com/questions/6383413/npm-install-issues-ubuntu-11-04

@rstacruz

This comment has been minimized.

Show comment
Hide comment
@rstacruz

rstacruz Aug 29, 2011

In Ubuntu, you may need to do sudo apt-get install libssl-dev before you can compile Node.

rstacruz commented Aug 29, 2011

In Ubuntu, you may need to do sudo apt-get install libssl-dev before you can compile Node.

@Ginny

This comment has been minimized.

Show comment
Hide comment
@Ginny

Ginny Aug 30, 2011

'install' finished successfully (12m33.358s)

Ginny commented Aug 30, 2011

'install' finished successfully (12m33.358s)

@triptych

This comment has been minimized.

Show comment
Hide comment
@triptych

triptych Sep 5, 2011

None of these worked for me as node gave me an out of memory error trying to run the node cli.js command. I was eventually able to get it working by loading the .pkg file here https://sites.google.com/site/nodejsmacosx/

triptych commented Sep 5, 2011

None of these worked for me as node gave me an out of memory error trying to run the node cli.js command. I was eventually able to get it working by loading the .pkg file here https://sites.google.com/site/nodejsmacosx/

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Sep 5, 2011

Owner

isaacs commented Sep 5, 2011

@ianswilliams

This comment has been minimized.

Show comment
Hide comment
@ianswilliams

ianswilliams Oct 2, 2011

Thankyou, my node/npm install got corrupted "somehow" , the first method about worked for me

ianswilliams commented Oct 2, 2011

Thankyou, my node/npm install got corrupted "somehow" , the first method about worked for me

@AlexZeitler

This comment has been minimized.

Show comment
Hide comment
@AlexZeitler

AlexZeitler Oct 21, 2011

I tried the first one using cygwin and I'm stuck with this:

curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7156 100 7156 0 0 14785 0 --:--:-- --:--:-- --:--:-- 25466
tar=/usr/bin/tar
version:
tar (GNU tar) 1.25
Packaged by Cygwin (1.25-1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
Installing without make. This may fail.
Failed to get tarball url for npm/latest

If I try the second, and run make install it seems to run forever at buid-doc.sh.

AlexZeitler commented Oct 21, 2011

I tried the first one using cygwin and I'm stuck with this:

curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7156 100 7156 0 0 14785 0 --:--:-- --:--:-- --:--:-- 25466
tar=/usr/bin/tar
version:
tar (GNU tar) 1.25
Packaged by Cygwin (1.25-1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
Installing without make. This may fail.
Failed to get tarball url for npm/latest

If I try the second, and run make install it seems to run forever at buid-doc.sh.

@clintandrewhall

This comment has been minimized.

Show comment
Hide comment
@clintandrewhall

clintandrewhall Nov 7, 2011

I had to add:

chmod 755 nave.sh

before line 10 in order for https://gist.github.com/579814#file_use_nave.sh to work properly. Did I miss something?

clintandrewhall commented Nov 7, 2011

I had to add:

chmod 755 nave.sh

before line 10 in order for https://gist.github.com/579814#file_use_nave.sh to work properly. Did I miss something?

@snapshot

This comment has been minimized.

Show comment
Hide comment
@snapshot

snapshot Nov 18, 2011

I am trying to install this using homebrew and I seeing the following permissions error.

Could not create /usr/local/lib/node_modules/___npm.npm
npm ERR! error installing npm@1.0.106 Error: EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules'

It looks like the install for npm is failing:
curl http://npmjs.org/install.sh | sh

To get this working I added

chown -R YOUR_USER_NAME:admin local/include/
chown -R YOUR_USER_NAME:admin local/lib/

I probably could also have run it the install command with sudo like this:

sudo curl http://npmjs.org/install.sh | sh

but the point of this gist is to install node and npm without having to sudo. However, at the end of the title at the top of this gist it says that npm >=0.3 is safer when using sudo. I am not sure if that means that you should install using sudo or chown the directory to $USER

snapshot commented Nov 18, 2011

I am trying to install this using homebrew and I seeing the following permissions error.

Could not create /usr/local/lib/node_modules/___npm.npm
npm ERR! error installing npm@1.0.106 Error: EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules'

It looks like the install for npm is failing:
curl http://npmjs.org/install.sh | sh

To get this working I added

chown -R YOUR_USER_NAME:admin local/include/
chown -R YOUR_USER_NAME:admin local/lib/

I probably could also have run it the install command with sudo like this:

sudo curl http://npmjs.org/install.sh | sh

but the point of this gist is to install node and npm without having to sudo. However, at the end of the title at the top of this gist it says that npm >=0.3 is safer when using sudo. I am not sure if that means that you should install using sudo or chown the directory to $USER

@azat

This comment has been minimized.

Show comment
Hide comment
@azat

azat commented Nov 29, 2011

@designerfuzzi

This comment has been minimized.

Show comment
Hide comment
@designerfuzzi

designerfuzzi Dec 1, 2011

which node.js version is the latest who support i386 MacOSX 10.5.8 ?
i tryed all versions, looks like its not documented about... just node-v0.4.9 was working at last.. all other had :bad error: bad cpu errors and so on, any install failed later or earlyer.. if someone calls a file mac-install package or means it is for a mac, then it has in my opinion to be for macs and not just for lion. because then it is just a lion install ^^
otherwise i'm the terminalator with my pocketcalculator! :-P
can anyone help out, with a precompiled package for osx10.5.8, or can send me 1000 dollar :D

designerfuzzi commented Dec 1, 2011

which node.js version is the latest who support i386 MacOSX 10.5.8 ?
i tryed all versions, looks like its not documented about... just node-v0.4.9 was working at last.. all other had :bad error: bad cpu errors and so on, any install failed later or earlyer.. if someone calls a file mac-install package or means it is for a mac, then it has in my opinion to be for macs and not just for lion. because then it is just a lion install ^^
otherwise i'm the terminalator with my pocketcalculator! :-P
can anyone help out, with a precompiled package for osx10.5.8, or can send me 1000 dollar :D

@AdrienGiboire

This comment has been minimized.

Show comment
Hide comment
@AdrienGiboire

AdrienGiboire commented Dec 6, 2011

Good to know: http://nodejs.org/dist/node-latest.tar.gz links to v0.6.4 but the latest is v0.6.5 (http://nodejs.org/dist/v0.6.5/node-v0.6.5.tar.gz).

@the0ther

This comment has been minimized.

Show comment
Hide comment
@the0ther

the0ther Jan 30, 2012

top one worked great for me on Ubuntu Server 11.04. thanks!

the0ther commented Jan 30, 2012

top one worked great for me on Ubuntu Server 11.04. thanks!

@boxxxie

This comment has been minimized.

Show comment
Hide comment
@boxxxie

boxxxie Mar 10, 2012

how do i update node.js?

i tried the first 2 methods and got the same error

src/unix/ev/ev.c: In function ‘ev_io_start’:
src/unix/ev/ev.c:2673: error: ‘EV_LIBUV_KQUEUE_HACK’ undeclared (first use in this function)
src/unix/ev/ev.c:2673: error: (Each undeclared identifier is reported only once
src/unix/ev/ev.c:2673: error: for each function it appears in.)
make[1]: *** [src/unix/ev/ev.o] Error 1
make[1]: Leaving directory /home/paul/node-latest-install/out/Release/deps/uv' Waf: Leaving directory/home/paul/node-latest-install/out'
Build failed: -> task failed (err #2):
{task: uv uv.h -> uv.a}
make: *** [install] Error 1

boxxxie commented Mar 10, 2012

how do i update node.js?

i tried the first 2 methods and got the same error

src/unix/ev/ev.c: In function ‘ev_io_start’:
src/unix/ev/ev.c:2673: error: ‘EV_LIBUV_KQUEUE_HACK’ undeclared (first use in this function)
src/unix/ev/ev.c:2673: error: (Each undeclared identifier is reported only once
src/unix/ev/ev.c:2673: error: for each function it appears in.)
make[1]: *** [src/unix/ev/ev.o] Error 1
make[1]: Leaving directory /home/paul/node-latest-install/out/Release/deps/uv' Waf: Leaving directory/home/paul/node-latest-install/out'
Build failed: -> task failed (err #2):
{task: uv uv.h -> uv.a}
make: *** [install] Error 1

@protoiyer

This comment has been minimized.

Show comment
Hide comment
@protoiyer

protoiyer May 21, 2012

In https://gist.github.com/579814#file_only_git_all_the_way.sh, there is no need to git clone the npm repo, as it is now made available when you install node itself. So can remove line numbers 15-18.

Also, this is how the node installation ended for me:

shebang #!~/local/bin/node /local/lib/node_modules/npm/bin/npm-cli.js
fs.js:280
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory '
/local/lib/node_modules/npm/bin/npm-cli.js'
at Object.openSync (fs.js:280:18)
at Object.readFileSync (fs.js:155:15)
at shebang (/home/proto/repos/node/tools/installer.js:53:20)
at run (/home/proto/repos/node/tools/installer.js:77:10)
at /home/proto/repos/node/tools/installer.js:85:7
at ChildProcess.exithandler (child_process.js:533:7)
at ChildProcess.emit (events.js:90:17)
at maybeClose (child_process.js:615:16)
at Process.onexit (child_process.js:655:5)
make: *** [install] Error 1

Though everything seems to be working ("node -v", "npm -v" returns proper values, and "npm install -g coffee-script" works), not sure why the above error happened, and what the implications are. Jotting it down here since someone else too might face the issue.

protoiyer commented May 21, 2012

In https://gist.github.com/579814#file_only_git_all_the_way.sh, there is no need to git clone the npm repo, as it is now made available when you install node itself. So can remove line numbers 15-18.

Also, this is how the node installation ended for me:

shebang #!~/local/bin/node /local/lib/node_modules/npm/bin/npm-cli.js
fs.js:280
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory '
/local/lib/node_modules/npm/bin/npm-cli.js'
at Object.openSync (fs.js:280:18)
at Object.readFileSync (fs.js:155:15)
at shebang (/home/proto/repos/node/tools/installer.js:53:20)
at run (/home/proto/repos/node/tools/installer.js:77:10)
at /home/proto/repos/node/tools/installer.js:85:7
at ChildProcess.exithandler (child_process.js:533:7)
at ChildProcess.emit (events.js:90:17)
at maybeClose (child_process.js:615:16)
at Process.onexit (child_process.js:655:5)
make: *** [install] Error 1

Though everything seems to be working ("node -v", "npm -v" returns proper values, and "npm install -g coffee-script" works), not sure why the above error happened, and what the implications are. Jotting it down here since someone else too might face the issue.

@danielwashbrook

This comment has been minimized.

Show comment
Hide comment
@danielwashbrook

danielwashbrook Jun 27, 2012

Just a note, you can't use the ~ for the reference to home and currently npm doesn't work with 0.9.0-pre so the git method fails

danielwashbrook commented Jun 27, 2012

Just a note, you can't use the ~ for the reference to home and currently npm doesn't work with 0.9.0-pre so the git method fails

@TimHeckel

This comment has been minimized.

Show comment
Hide comment
@TimHeckel

TimHeckel Nov 16, 2012

Running Ubuntu 12.04, I kept running into this error when running make install

/home/tim/node-latest-install/out/Release/obj.target/v8_base/deps/v8/src/accessors.o ../deps/v8/src/accessors.cc
make[1]: g++: Command not found

My vm was brand spanking new, so I had to install this before make install would work

sudo apt-get install build-essential libssl-dev curl git-core

TimHeckel commented Nov 16, 2012

Running Ubuntu 12.04, I kept running into this error when running make install

/home/tim/node-latest-install/out/Release/obj.target/v8_base/deps/v8/src/accessors.o ../deps/v8/src/accessors.cc
make[1]: g++: Command not found

My vm was brand spanking new, so I had to install this before make install would work

sudo apt-get install build-essential libssl-dev curl git-core
@andremendesc

This comment has been minimized.

Show comment
Hide comment
@andremendesc

andremendesc Jan 22, 2013

Just used the first one at Amazon EC2, awesome, thanks.

andremendesc commented Jan 22, 2013

Just used the first one at Amazon EC2, awesome, thanks.

@aryehischechter

This comment has been minimized.

Show comment
Hide comment
@aryehischechter

aryehischechter Apr 28, 2013

I don't know why installing npmjs didn't work using the first method but this is what I'm getting.
help would be appreciated.
npm ERR! Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR! { [Error: EACCES, unlink '/home/enduser/local/bin/npm'] errno: 3, code: 'EACCES', path: '/home/enduser/local/bin/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/enduser/local/bin/node" "/tmp/npm.14923/package/cli.js" "rm" "npm" "-gf"
npm ERR! cwd /tmp/npm.14923/package
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path /home/enduser/local/bin/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.14923/package/npm-debug.log
npm ERR! not ok code 0

npm@1.2.18 prepublish .
node bin/npm-cli.js prune ; rm -rf test///node_modules ; make -j4 doc

make: Nothing to be done for `doc'.
npm ERR! error rolling back Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR! error rolling back npm@1.2.18 { [Error: EACCES, unlink '/home/enduser/local/bin/npm'] errno: 3, code: 'EACCES', path: '/home/enduser/local/bin/npm' }
npm ERR! Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR! { [Error: EACCES, unlink '/home/enduser/local/bin/npm'] errno: 3, code: 'EACCES', path: '/home/enduser/local/bin/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/enduser/local/bin/node" "/tmp/npm.14923/package/cli.js" "install" "-gf"
npm ERR! cwd /tmp/npm.14923/package
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path /home/enduser/local/bin/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.14923/package/npm-debug.log
npm ERR! not ok code 0
It failed

aryehischechter commented Apr 28, 2013

I don't know why installing npmjs didn't work using the first method but this is what I'm getting.
help would be appreciated.
npm ERR! Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR! { [Error: EACCES, unlink '/home/enduser/local/bin/npm'] errno: 3, code: 'EACCES', path: '/home/enduser/local/bin/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/enduser/local/bin/node" "/tmp/npm.14923/package/cli.js" "rm" "npm" "-gf"
npm ERR! cwd /tmp/npm.14923/package
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path /home/enduser/local/bin/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.14923/package/npm-debug.log
npm ERR! not ok code 0

npm@1.2.18 prepublish .
node bin/npm-cli.js prune ; rm -rf test///node_modules ; make -j4 doc

make: Nothing to be done for `doc'.
npm ERR! error rolling back Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR! error rolling back npm@1.2.18 { [Error: EACCES, unlink '/home/enduser/local/bin/npm'] errno: 3, code: 'EACCES', path: '/home/enduser/local/bin/npm' }
npm ERR! Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR! { [Error: EACCES, unlink '/home/enduser/local/bin/npm'] errno: 3, code: 'EACCES', path: '/home/enduser/local/bin/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/enduser/local/bin/node" "/tmp/npm.14923/package/cli.js" "install" "-gf"
npm ERR! cwd /tmp/npm.14923/package
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path /home/enduser/local/bin/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/home/enduser/local/bin/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.14923/package/npm-debug.log
npm ERR! not ok code 0
It failed

@lucasbiguet

This comment has been minimized.

Show comment
Hide comment
@lucasbiguet

lucasbiguet May 22, 2013

apparently you still need admin rights to install npm. I just had the same issue, so I manually downloaded the install script and "sudoed" it:

cd ~
wget https://npmjs.org/install.sh
chmod +x install.sh
sudo ./install.sh

No error messages so apparently it worked :)

lucasbiguet commented May 22, 2013

apparently you still need admin rights to install npm. I just had the same issue, so I manually downloaded the install script and "sudoed" it:

cd ~
wget https://npmjs.org/install.sh
chmod +x install.sh
sudo ./install.sh

No error messages so apparently it worked :)

@morales2k

This comment has been minimized.

Show comment
Hide comment
@morales2k

morales2k May 24, 2013

This helped me out... and in my case, (CentOS 6.3) EPEL repo has this jewel of a software, so it is a reliable package maintainer... This was really easy.

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

morales2k commented May 24, 2013

This helped me out... and in my case, (CentOS 6.3) EPEL repo has this jewel of a software, so it is a reliable package maintainer... This was really easy.

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

@manojwins

This comment has been minimized.

Show comment
Hide comment
@manojwins

manojwins May 27, 2013

I am getting this error in both method 1 and 2. Can someone please help?

root@web [/node]# ./configure --prefix=~/local
File "./configure", line 427
arm_float_abi = 'hard' if is_arm_hard_float_abi() else 'default'
^
SyntaxError: invalid syntax

manojwins commented May 27, 2013

I am getting this error in both method 1 and 2. Can someone please help?

root@web [/node]# ./configure --prefix=~/local
File "./configure", line 427
arm_float_abi = 'hard' if is_arm_hard_float_abi() else 'default'
^
SyntaxError: invalid syntax

@francisbyrne

This comment has been minimized.

Show comment
Hide comment
@francisbyrne

francisbyrne Jun 19, 2013

I got an error at the same step as above except a different line:

bash-3.2$ ./configure --prefix=~/local
File "./configure", line 441
fpu = 'vfpv3' if armv7 else 'vfpv2'
^
SyntaxError: invalid syntax

francisbyrne commented Jun 19, 2013

I got an error at the same step as above except a different line:

bash-3.2$ ./configure --prefix=~/local
File "./configure", line 441
fpu = 'vfpv3' if armv7 else 'vfpv2'
^
SyntaxError: invalid syntax

@francisbyrne

This comment has been minimized.

Show comment
Hide comment
@francisbyrne

francisbyrne commented Jun 19, 2013

Nevermind, looks like I was using an old Python version:
http://stackoverflow.com/questions/14989164/node-js-configure-file-syntax-error-line-433

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jun 27, 2013

Worked here. Ubuntu 13.04 64 bits. Thanks :)

ghost commented Jun 27, 2013

Worked here. Ubuntu 13.04 64 bits. Thanks :)

@symsun

This comment has been minimized.

Show comment
Hide comment
@symsun

symsun Jun 28, 2013

First one is not working for me also. Someone pls help.

[root@sddev node-latest-install]# ./configure --prefix=~/local
File "./configure", line 441
fpu = 'vfpv3' if armv7 else 'vfpv2'
^
SyntaxError: invalid syntax

symsun commented Jun 28, 2013

First one is not working for me also. Someone pls help.

[root@sddev node-latest-install]# ./configure --prefix=~/local
File "./configure", line 441
fpu = 'vfpv3' if armv7 else 'vfpv2'
^
SyntaxError: invalid syntax

@zweiland

This comment has been minimized.

Show comment
Hide comment
@zweiland

zweiland Jul 2, 2013

top worked beautifully! thanks man!

zweiland commented Jul 2, 2013

top worked beautifully! thanks man!

@Jerbot

This comment has been minimized.

Show comment
Hide comment
@Jerbot

Jerbot Jul 5, 2013

Step 9, method 1:

"npm cannot be installed without nodejs.
Install node first, and then try again.

"Maybe node is installed, but not in the PATH?
Note that running as sudo can change envs."

Jerbot commented Jul 5, 2013

Step 9, method 1:

"npm cannot be installed without nodejs.
Install node first, and then try again.

"Maybe node is installed, but not in the PATH?
Note that running as sudo can change envs."

@zarac

This comment has been minimized.

Show comment
Hide comment
@zarac

zarac Aug 6, 2013

The configure script for only-git-all-the-way.sh is in python2 - this will cause parse errors if python3 is the default on your system. One solution is to add a symbolic link to python2 inside your ~/local/bin.

cd ~/local/bin
ln -s /usr/bin/python2 ./python

zarac commented Aug 6, 2013

The configure script for only-git-all-the-way.sh is in python2 - this will cause parse errors if python3 is the default on your system. One solution is to add a symbolic link to python2 inside your ~/local/bin.

cd ~/local/bin
ln -s /usr/bin/python2 ./python

@ltcastro

This comment has been minimized.

Show comment
Hide comment
@ltcastro

ltcastro Aug 19, 2013

I thought "PROFESSIONALS" developed node.js?????

It is a garbage install process for the mac. The install directory is hidden/protected: /usr/local/bin...

WTF?

ltcastro commented Aug 19, 2013

I thought "PROFESSIONALS" developed node.js?????

It is a garbage install process for the mac. The install directory is hidden/protected: /usr/local/bin...

WTF?

@ltcastro

This comment has been minimized.

Show comment
Hide comment
@ltcastro

ltcastro Aug 19, 2013

It is hard to have ANY confidence in developers that can NOT even get an installer right.

ltcastro commented Aug 19, 2013

It is hard to have ANY confidence in developers that can NOT even get an installer right.

@ltcastro

This comment has been minimized.

Show comment
Hide comment
@ltcastro

ltcastro Aug 19, 2013

Can you imagine if surgeons and real professionals did their work so poorly? I am obviously very pissed that I just wasted two hours on what should be simple.

ltcastro commented Aug 19, 2013

Can you imagine if surgeons and real professionals did their work so poorly? I am obviously very pissed that I just wasted two hours on what should be simple.

@viktor-evdokimov

This comment has been minimized.

Show comment
Hide comment
@viktor-evdokimov

viktor-evdokimov Aug 29, 2013

@itcastro maybe you should do something else if you failed to open http://nodejs.org/ and download installer in the first place.

viktor-evdokimov commented Aug 29, 2013

@itcastro maybe you should do something else if you failed to open http://nodejs.org/ and download installer in the first place.

@leto

This comment has been minimized.

Show comment
Hide comment
@leto

leto Aug 29, 2013

./configure --prefix=/local does not work on my system, it creates a directory called "". The more defensive way is to do:

./configure --prefix=$HOME/local

leto commented Aug 29, 2013

./configure --prefix=/local does not work on my system, it creates a directory called "". The more defensive way is to do:

./configure --prefix=$HOME/local

@modi2020

This comment has been minimized.

Show comment
Hide comment
@modi2020

modi2020 Sep 6, 2013

I love this.....works like charm
keep up the good work

Thank you so much!

modi2020 commented Sep 6, 2013

I love this.....works like charm
keep up the good work

Thank you so much!

@kereg

This comment has been minimized.

Show comment
Hide comment
@kereg

kereg Oct 2, 2013

Thanks!!
Your awesome script node-and-npm-in-30-seconds.sh worked like a charm on my fedora 17.

No 30 seconds here....

kereg commented Oct 2, 2013

Thanks!!
Your awesome script node-and-npm-in-30-seconds.sh worked like a charm on my fedora 17.

No 30 seconds here....

@jochenvanwylick

This comment has been minimized.

Show comment
Hide comment
@jochenvanwylick

jochenvanwylick Oct 3, 2013

Hi all - I'm pretty new to this but I read (and confirmed that it works for me) that using make -j (so with the -j flag) uses all processor cores and in my case (8 cores) makes it go A LOT faster.

jochenvanwylick commented Oct 3, 2013

Hi all - I'm pretty new to this but I read (and confirmed that it works for me) that using make -j (so with the -j flag) uses all processor cores and in my case (8 cores) makes it go A LOT faster.

@firstdoit

This comment has been minimized.

Show comment
Hide comment
@firstdoit

firstdoit Oct 18, 2013

On "take-ownership", the directory structure for the node dist is wrong.

curl http://nodejs.org/dist/node-v0.4.3.tar.gz | tar -xzf - -C node-install

should be

curl http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz | tar -xzf - -C node-install

firstdoit commented Oct 18, 2013

On "take-ownership", the directory structure for the node dist is wrong.

curl http://nodejs.org/dist/node-v0.4.3.tar.gz | tar -xzf - -C node-install

should be

curl http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz | tar -xzf - -C node-install

@shashankgroovy

This comment has been minimized.

Show comment
Hide comment
@shashankgroovy

shashankgroovy Oct 19, 2013

node-and-npm-in-30-seconds.sh ftw \m/
worked flawlessly . Love it

thank you so much!

shashankgroovy commented Oct 19, 2013

node-and-npm-in-30-seconds.sh ftw \m/
worked flawlessly . Love it

thank you so much!

@SgtPooki

This comment has been minimized.

Show comment
Hide comment
@SgtPooki

SgtPooki Oct 20, 2013

@leto, ./configure --prefix=$home/local fixed the issues I was having with #2. Thanks!

SgtPooki commented Oct 20, 2013

@leto, ./configure --prefix=$home/local fixed the issues I was having with #2. Thanks!

@valtonio

This comment has been minimized.

Show comment
Hide comment
@valtonio

valtonio Oct 29, 2013

The first one doesn't work on OSX 10.9.
Getting
curl: (60) SSL certificate problem: Invalid certificate chain
on the last step.

valtonio commented Oct 29, 2013

The first one doesn't work on OSX 10.9.
Getting
curl: (60) SSL certificate problem: Invalid certificate chain
on the last step.

@billstron

This comment has been minimized.

Show comment
Hide comment
@billstron

billstron Nov 2, 2013

Actually, the problems with #2 are fixed with ./configure --prefix=$HOME/local. The home variable is capitalized.

billstron commented Nov 2, 2013

Actually, the problems with #2 are fixed with ./configure --prefix=$HOME/local. The home variable is capitalized.

@michael-yin

This comment has been minimized.

Show comment
Hide comment
@michael-yin

michael-yin Nov 3, 2013

Thank you very much..I have installed node in ubuntu.
Just one suggestion, the latest version of node has included npm, so the last line of code can be removed...^_^

michael-yin commented Nov 3, 2013

Thank you very much..I have installed node in ubuntu.
Just one suggestion, the latest version of node has included npm, so the last line of code can be removed...^_^

@johanbaaij

This comment has been minimized.

Show comment
Hide comment
@johanbaaij

johanbaaij Nov 17, 2013

I'm also getting this with the 30 second method.

"npm cannot be installed without nodejs.
Install node first, and then try again.

Maybe node is installed, but not in the PATH?
Note that running as sudo can change envs."

I'm pretty sure node installed although i do not seem to be able to run it. do i just delete /node-latest-install if i would want to try another method?

johanbaaij commented Nov 17, 2013

I'm also getting this with the 30 second method.

"npm cannot be installed without nodejs.
Install node first, and then try again.

Maybe node is installed, but not in the PATH?
Note that running as sudo can change envs."

I'm pretty sure node installed although i do not seem to be able to run it. do i just delete /node-latest-install if i would want to try another method?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 17, 2013

@johan010 npm comes packaged with nodejs now so you can ignore the part about installing npm

ghost commented Nov 17, 2013

@johan010 npm comes packaged with nodejs now so you can ignore the part about installing npm

@hereandnow

This comment has been minimized.

Show comment
Hide comment
@hereandnow

hereandnow Nov 27, 2013

i used nvm which gives you the added bonus of easy node.js-version switching:

# see more about nvm: https://github.com/creationix/nvm
# added bonus: gives you the opportunity to switch node versions
 
# install nvm
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
 
# reload bash_profile
source ~/.bash_profile
 
# install a node.js version, edit the version you want to use
nvm install v0.10.22

hereandnow commented Nov 27, 2013

i used nvm which gives you the added bonus of easy node.js-version switching:

# see more about nvm: https://github.com/creationix/nvm
# added bonus: gives you the opportunity to switch node versions
 
# install nvm
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
 
# reload bash_profile
source ~/.bash_profile
 
# install a node.js version, edit the version you want to use
nvm install v0.10.22
@dougturnkey

This comment has been minimized.

Show comment
Hide comment
@dougturnkey

dougturnkey Dec 2, 2013

Wow - wish i'd found this page like a year ago. :) stackoverflow answer is crap.

dougturnkey commented Dec 2, 2013

Wow - wish i'd found this page like a year ago. :) stackoverflow answer is crap.

@meeb0

This comment has been minimized.

Show comment
Hide comment
@meeb0

meeb0 Dec 5, 2013

Wonderful...

meeb0 commented Dec 5, 2013

Wonderful...

@janraasch

This comment has been minimized.

Show comment
Hide comment
@janraasch

janraasch Dec 22, 2013

This is beautiful.

janraasch commented Dec 22, 2013

This is beautiful.

@firstdoit

This comment has been minimized.

Show comment
Hide comment
@firstdoit

firstdoit Jan 6, 2014

In addition to the first script, I run this on new systems for easy sudo'ing, when (rarely) needed:

#!/bin/bash
ln -s $HOME/local/bin/node /usr/bin/node
ln -s $HOME/local/lib/node /usr/lib/node
ln -s $HOME/local/bin/npm /usr/bin/npm
ln -s $HOME/local/bin/node-waf /usr/bin/node-waf

firstdoit commented Jan 6, 2014

In addition to the first script, I run this on new systems for easy sudo'ing, when (rarely) needed:

#!/bin/bash
ln -s $HOME/local/bin/node /usr/bin/node
ln -s $HOME/local/lib/node /usr/lib/node
ln -s $HOME/local/bin/npm /usr/bin/npm
ln -s $HOME/local/bin/node-waf /usr/bin/node-waf
@patorjk

This comment has been minimized.

Show comment
Hide comment
@patorjk

patorjk Feb 12, 2014

Just as a heads up, for the "node-and-npm-in-30-seconds.sh" gist I had to add www to the npmjs URL since it was returning HTML. Ex:

$ curl --proxy [proxy here] https://npmjs.org/install.sh install.sh
< html>Moved: < a href="https://www.npmjs.org/install.sh">https://www.npmjs.org/install.sh< /a>
< html>
...

patorjk commented Feb 12, 2014

Just as a heads up, for the "node-and-npm-in-30-seconds.sh" gist I had to add www to the npmjs URL since it was returning HTML. Ex:

$ curl --proxy [proxy here] https://npmjs.org/install.sh install.sh
< html>Moved: < a href="https://www.npmjs.org/install.sh">https://www.npmjs.org/install.sh< /a>
< html>
...

@aebm

This comment has been minimized.

Show comment
Hide comment
@aebm

aebm Feb 17, 2014

Hi Isaac,

I have updated the 30 seconds install to the new npm url. Here is the link to the gist https://gist.github.com/aebm/9047011

Regards

aebm commented Feb 17, 2014

Hi Isaac,

I have updated the 30 seconds install to the new npm url. Here is the link to the gist https://gist.github.com/aebm/9047011

Regards

@randwa1k

This comment has been minimized.

Show comment
Hide comment
@randwa1k

randwa1k Feb 17, 2014

Can someone explain what each step in "node-and-npm-in-30-seconds.sh" does? I'd like to know the reasons behind each line.

randwa1k commented Feb 17, 2014

Can someone explain what each step in "node-and-npm-in-30-seconds.sh" does? I'd like to know the reasons behind each line.

@ict4eo

This comment has been minimized.

Show comment
Hide comment
@ict4eo

ict4eo Feb 26, 2014

Hi Isaac

I am trying to use the npm install procedure "node-and-npm-in-30-seconds.sh" (actually part of a Dockerfile I am creating to install cartoDB).

The final output is this:

...
creating ./config.gypi
creating ./config.mk
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
03 0:00:03 --:--:-- 80
sh: 1: cannot open html: No such file
sh: 2: Syntax error: redirection unexpected

Do you have any idea what can cause this?

ict4eo commented Feb 26, 2014

Hi Isaac

I am trying to use the npm install procedure "node-and-npm-in-30-seconds.sh" (actually part of a Dockerfile I am creating to install cartoDB).

The final output is this:

...
creating ./config.gypi
creating ./config.mk
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
03 0:00:03 --:--:-- 80
sh: 1: cannot open html: No such file
sh: 2: Syntax error: redirection unexpected

Do you have any idea what can cause this?

@ict4eo

This comment has been minimized.

Show comment
Hide comment
@ict4eo

ict4eo Feb 27, 2014

Hi Isaac

When I try the second script (again, inside Docker), it also fails with this message:

Cloning into 'npm'...
rm -rf
.building_ronn
html/doc
html/api
man
scripts/doc-build.sh doc/api/npm-test.md man/man3/npm-test.3
make[1]: Entering directory '/npm'
node cli.js install ronn --no-global
bash: node: command not found
make[1]: Leaving directory '/npm'
make[1]: *** [node_modules/.bin/ronn] Error 127
*** [man/man3/npm-test.3] Error 2

ict4eo commented Feb 27, 2014

Hi Isaac

When I try the second script (again, inside Docker), it also fails with this message:

Cloning into 'npm'...
rm -rf
.building_ronn
html/doc
html/api
man
scripts/doc-build.sh doc/api/npm-test.md man/man3/npm-test.3
make[1]: Entering directory '/npm'
node cli.js install ronn --no-global
bash: node: command not found
make[1]: Leaving directory '/npm'
make[1]: *** [node_modules/.bin/ronn] Error 127
*** [man/man3/npm-test.3] Error 2

@ferantivero

This comment has been minimized.

Show comment
Hide comment
@ferantivero

ferantivero Feb 28, 2014

hi Isaac/guys couldn't execute the 30-secs-way without errors. Even I tried to fix it with no luck by playing around with most of the aforementioned variants. So just went to nodejs.org and click install. It downloads the latest node dist.

Then, I followed the readme instructions and got node installed (it seems that it comes with npm now)

My question is, am I missing something installing node+npm in this way?

Thanks,

ferantivero commented Feb 28, 2014

hi Isaac/guys couldn't execute the 30-secs-way without errors. Even I tried to fix it with no luck by playing around with most of the aforementioned variants. So just went to nodejs.org and click install. It downloads the latest node dist.

Then, I followed the readme instructions and got node installed (it seems that it comes with npm now)

My question is, am I missing something installing node+npm in this way?

Thanks,

@kurotek

This comment has been minimized.

Show comment
Hide comment
@kurotek

kurotek Mar 3, 2014

Just a note, right now npmjs.org is throwing 301 redirects when you try and access without prefixing the www subdomain https://npmjs.org/install.sh

e.g.

curl -v https://npmjs.org/install.sh

The solution is to either manually change for the redirect

curl -v https://www.npmjs.org/install.sh

Or just use the -L option to tell curl to follow redirects

curl -Lv https://www.npmjs.org/install.sh

After making one of those changes, the gists should work.

kurotek commented Mar 3, 2014

Just a note, right now npmjs.org is throwing 301 redirects when you try and access without prefixing the www subdomain https://npmjs.org/install.sh

e.g.

curl -v https://npmjs.org/install.sh

The solution is to either manually change for the redirect

curl -v https://www.npmjs.org/install.sh

Or just use the -L option to tell curl to follow redirects

curl -Lv https://www.npmjs.org/install.sh

After making one of those changes, the gists should work.

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Mar 11, 2014

Just updated the scripts to add the www to the urls. Sorry about that, folks.

Owner

isaacs commented Mar 11, 2014

Just updated the scripts to add the www to the urls. Sorry about that, folks.

@landed1

This comment has been minimized.

Show comment
Hide comment
@landed1

landed1 Mar 12, 2014

For some reason after maybe a restart yo command not found and also the same for npm. This was bugging me as it was happening after time periods...thought it must be a restart...

and running . ~/.bashrc solved my issue ! So how do I persist this ? In this file I have

export PATH=$HOME/local/bin:$PATH
export PATH=$HOME/local/lib/:$PATH

I thought those 2 lines would export the lines in the main paths file ?

So I guess I might need these added to my main etc/paths file right (but why didnt the exports work???)

[paths file]
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/User/calvin/local/bin

can I add it like

~/local/lib
~/local/bin

??

landed1 commented Mar 12, 2014

For some reason after maybe a restart yo command not found and also the same for npm. This was bugging me as it was happening after time periods...thought it must be a restart...

and running . ~/.bashrc solved my issue ! So how do I persist this ? In this file I have

export PATH=$HOME/local/bin:$PATH
export PATH=$HOME/local/lib/:$PATH

I thought those 2 lines would export the lines in the main paths file ?

So I guess I might need these added to my main etc/paths file right (but why didnt the exports work???)

[paths file]
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/User/calvin/local/bin

can I add it like

~/local/lib
~/local/bin

??

@fritx

This comment has been minimized.

Show comment
Hide comment
@fritx

fritx commented Mar 22, 2014

@fabiomaia

This comment has been minimized.

Show comment
Hide comment

fabiomaia commented Mar 23, 2014

@sungwon

This comment has been minimized.

Show comment
Hide comment
@sungwon

sungwon Mar 25, 2014

ict4eo, I was getting the same error on my ubuntu system for the 2nd script and realized that it was compiling into the wrong directory (it actually made a directory named "~" in the current directory rather than using the home directory).

I changed:
./configure --prefix=~/local
by replacing the ~ with the full path to my home directory (e.g. '/home/username/local' where username is your username).

But I would grateful if someone could explain why the tilde did not work.

sungwon commented Mar 25, 2014

ict4eo, I was getting the same error on my ubuntu system for the 2nd script and realized that it was compiling into the wrong directory (it actually made a directory named "~" in the current directory rather than using the home directory).

I changed:
./configure --prefix=~/local
by replacing the ~ with the full path to my home directory (e.g. '/home/username/local' where username is your username).

But I would grateful if someone could explain why the tilde did not work.

@anthonybrown

This comment has been minimized.

Show comment
Hide comment
@anthonybrown

anthonybrown Apr 2, 2014

The homebrew install should be brew install node --without-npm or brew will install npm by default
I didn't read the whole comments so if this is a repeat, my apologise

anthonybrown commented Apr 2, 2014

The homebrew install should be brew install node --without-npm or brew will install npm by default
I didn't read the whole comments so if this is a repeat, my apologise

@mrzool

This comment has been minimized.

Show comment
Hide comment
@mrzool

mrzool Apr 7, 2014

@sungwon same thing here. running that second script threw me into a world of pain. took me 1 hour to figure out what the problem was.

mrzool commented Apr 7, 2014

@sungwon same thing here. running that second script threw me into a world of pain. took me 1 hour to figure out what the problem was.

@shettypuneeth

This comment has been minimized.

Show comment
Hide comment
@shettypuneeth

shettypuneeth Apr 19, 2014

First method worked, even thought it took a lot more than 30 seconds. Thanks.
Had to remove all the files and folder associated with the previous node install for it to work.

shettypuneeth commented Apr 19, 2014

First method worked, even thought it took a lot more than 30 seconds. Thanks.
Had to remove all the files and folder associated with the previous node install for it to work.

@hektech

This comment has been minimized.

Show comment
Hide comment
@hektech

hektech Apr 24, 2014

First method helped me move forward with node. Thanks! One note: npm is included with the node install, so I skipped the last step and works fine (use "npm -v" to see which version you have).

hektech commented Apr 24, 2014

First method helped me move forward with node. Thanks! One note: npm is included with the node install, so I skipped the last step and works fine (use "npm -v" to see which version you have).

@binarykitchen

This comment has been minimized.

Show comment
Hide comment
@binarykitchen

binarykitchen May 7, 2014

I installed nave like use-nave.sh but have issues here:

$ nave
zsh: permission denied: nave

Permission denied? Huh. It has all the correct permissions in /usr/local/bin:

lrwxrwxrwx  1 root root   37 May  7 12:56 nave -> /home/michael.heuberger/.nave/nave.sh

but I can run nave with bash nave. When I try to install a node version, it gets installed but it won't find the node command afterwards.

I'm using Ubuntu 14.04 and ZSH here. Any clues?

binarykitchen commented May 7, 2014

I installed nave like use-nave.sh but have issues here:

$ nave
zsh: permission denied: nave

Permission denied? Huh. It has all the correct permissions in /usr/local/bin:

lrwxrwxrwx  1 root root   37 May  7 12:56 nave -> /home/michael.heuberger/.nave/nave.sh

but I can run nave with bash nave. When I try to install a node version, it gets installed but it won't find the node command afterwards.

I'm using Ubuntu 14.04 and ZSH here. Any clues?

@allthetime

This comment has been minimized.

Show comment
Hide comment
@allthetime

allthetime May 27, 2014

Couldn't install properly with BREW for some reason. Used the top .sh and it was flawless. Thanks for the scripts!

allthetime commented May 27, 2014

Couldn't install properly with BREW for some reason. Used the top .sh and it was flawless. Thanks for the scripts!

@twincharged

This comment has been minimized.

Show comment
Hide comment
@twincharged

twincharged May 31, 2014

Note for anyone having trouble with installing/using node and or npm (especially after restarting the terminal) - For me the PATH for node needed to be
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bash_profile
. ~/.bash_profile
If your bash_profile does not read bashrc, then using bash_profile instead of bashrc in setting the path will fix the problem for you.

twincharged commented May 31, 2014

Note for anyone having trouble with installing/using node and or npm (especially after restarting the terminal) - For me the PATH for node needed to be
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bash_profile
. ~/.bash_profile
If your bash_profile does not read bashrc, then using bash_profile instead of bashrc in setting the path will fix the problem for you.

@twlkyao

This comment has been minimized.

Show comment
Hide comment
@twlkyao

twlkyao Jun 7, 2014

I use the second, and it works.

twlkyao commented Jun 7, 2014

I use the second, and it works.

@renoth

This comment has been minimized.

Show comment
Hide comment
@renoth

renoth Jun 10, 2014

the last one ... piping curl into your shell ... this is clearly a joke isnt it?

renoth commented Jun 10, 2014

the last one ... piping curl into your shell ... this is clearly a joke isnt it?

@01010000101001100

This comment has been minimized.

Show comment
Hide comment
@01010000101001100

01010000101001100 Jun 11, 2014

Should I go with this one or noob-node-package-installer? :D

01010000101001100 commented Jun 11, 2014

Should I go with this one or noob-node-package-installer? :D

@microbial

This comment has been minimized.

Show comment
Hide comment
@microbial

microbial Jun 14, 2014

30-second one worked for me. Can't believe this post is over 4-years old and still timely.

microbial commented Jun 14, 2014

30-second one worked for me. Can't believe this post is over 4-years old and still timely.

@mkalygin

This comment has been minimized.

Show comment
Hide comment
@mkalygin

mkalygin Jun 21, 2014

Regarding take-ownership.sh approach. Please, do the following:

  • replace http://nodejs.org/dist/node-v0.4.3.tar.gz with http://nodejs.org/dist/node-latest.tar.gz to install the latest version of node.js (I had a build error because of missing SSLv2_method, Elementary OS Luna);
  • add sudo sh to the npm installation: curl https://www.npmjs.org/install.sh | sudo sh (I had EACCESS error).

Thanks!

mkalygin commented Jun 21, 2014

Regarding take-ownership.sh approach. Please, do the following:

  • replace http://nodejs.org/dist/node-v0.4.3.tar.gz with http://nodejs.org/dist/node-latest.tar.gz to install the latest version of node.js (I had a build error because of missing SSLv2_method, Elementary OS Luna);
  • add sudo sh to the npm installation: curl https://www.npmjs.org/install.sh | sudo sh (I had EACCESS error).

Thanks!

@e-oz

This comment has been minimized.

Show comment
Hide comment

e-oz commented Jun 23, 2014

@petterg

This comment has been minimized.

Show comment
Hide comment
@petterg

petterg Jun 29, 2014

On my gentoo system I get:

export PYTHON=/usr/bin/python2.7
$PYTHON ./configure --prefix=$HOME/js/js-libraries/node
make

../../src/weak_collection.js ../../src/promise.js ../../src/object-observe.js ../../src/macros.py
Traceback (most recent call last):
File "../../tools/js2c.py", line 514, in
main()
File "../../tools/js2c.py", line 510, in main
JS2C(args[3:], args[0], args[1], args[2], options.raw, options.omit)
File "../../tools/js2c.py", line 481, in JS2C
sources = PrepareSources(source)
File "../../tools/js2c.py", line 372, in PrepareSources
assert len(macro_files) in [0, 1]
TypeError: object of type 'filter' has no len()

It seems like something does not honor the $PYTHON setting and is just calling "python" which gives python3 and the above error

petterg commented Jun 29, 2014

On my gentoo system I get:

export PYTHON=/usr/bin/python2.7
$PYTHON ./configure --prefix=$HOME/js/js-libraries/node
make

../../src/weak_collection.js ../../src/promise.js ../../src/object-observe.js ../../src/macros.py
Traceback (most recent call last):
File "../../tools/js2c.py", line 514, in
main()
File "../../tools/js2c.py", line 510, in main
JS2C(args[3:], args[0], args[1], args[2], options.raw, options.omit)
File "../../tools/js2c.py", line 481, in JS2C
sources = PrepareSources(source)
File "../../tools/js2c.py", line 372, in PrepareSources
assert len(macro_files) in [0, 1]
TypeError: object of type 'filter' has no len()

It seems like something does not honor the $PYTHON setting and is just calling "python" which gives python3 and the above error

@rannday

This comment has been minimized.

Show comment
Hide comment
@rannday

rannday Jul 11, 2014

I thought the first one might work, but it didn't. But I also forgot to install build-essentials. Either way, I went with the way I usually use, which is:

mkdir ~/local
cd ~/Downloads
wget http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz

tar -zxvf node*
cd node*
./configure --prefix=/home/rann/local
make
make install
echo 'export PATH=/home/rann/opt/bin:${PATH}' >> ~/.bashrc
. ~/.bashrc
node -v
npm -v

rannday commented Jul 11, 2014

I thought the first one might work, but it didn't. But I also forgot to install build-essentials. Either way, I went with the way I usually use, which is:

mkdir ~/local
cd ~/Downloads
wget http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz

tar -zxvf node*
cd node*
./configure --prefix=/home/rann/local
make
make install
echo 'export PATH=/home/rann/opt/bin:${PATH}' >> ~/.bashrc
. ~/.bashrc
node -v
npm -v

@rafaelrinaldi

This comment has been minimized.

Show comment
Hide comment
@rafaelrinaldi

rafaelrinaldi Jul 11, 2014

For the record, I was having problems with the npm easy-install process. Just changed it to exec the script with sudo after its download and got it to work:

curl https://www.npmjs.org/install.sh | sudo sh

rafaelrinaldi commented Jul 11, 2014

For the record, I was having problems with the npm easy-install process. Just changed it to exec the script with sudo after its download and got it to work:

curl https://www.npmjs.org/install.sh | sudo sh

@justjoolz

This comment has been minimized.

Show comment
Hide comment
@justjoolz

justjoolz Jul 14, 2014

First one gave me these errors:

npm ERR! Error: EACCES, mkdir '/usr/local/share/man/man1'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/share/man/man1']
npm ERR! stack: 'Error: EACCES, mkdir '/usr/local/share/man/man1'\n at Error (native)',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/share/man/man1' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/home/j00lz/.nvm/v0.11.13/bin/node" "/tmp/npm.9758/package/cli.js" "install" "-gf"
npm ERR! cwd /tmp/npm.9758/package
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.20
npm ERR! path /usr/local/share/man/man1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! stack Error: EACCES, mkdir '/usr/local/share/man/man1'
npm ERR! stack at Error (native)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.9758/package/npm-debug.log
npm ERR! not ok code 0

justjoolz commented Jul 14, 2014

First one gave me these errors:

npm ERR! Error: EACCES, mkdir '/usr/local/share/man/man1'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/share/man/man1']
npm ERR! stack: 'Error: EACCES, mkdir '/usr/local/share/man/man1'\n at Error (native)',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/share/man/man1' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/home/j00lz/.nvm/v0.11.13/bin/node" "/tmp/npm.9758/package/cli.js" "install" "-gf"
npm ERR! cwd /tmp/npm.9758/package
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.20
npm ERR! path /usr/local/share/man/man1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! stack Error: EACCES, mkdir '/usr/local/share/man/man1'
npm ERR! stack at Error (native)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.9758/package/npm-debug.log
npm ERR! not ok code 0

@mryellow

This comment has been minimized.

Show comment
Hide comment
@mryellow

mryellow Jul 21, 2014

Git, path problem.

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

Following the instructions it's actually installed to $HOME/local/node.

mryellow commented Jul 21, 2014

Git, path problem.

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

Following the instructions it's actually installed to $HOME/local/node.

@meawoppl

This comment has been minimized.

Show comment
Hide comment
@meawoppl

meawoppl Jul 25, 2014

I would add a note about python version early on. It it would be accepted, I would write a PR to add portability. At the very least, make some noise about using py2 and crashing-out explicitly

meawoppl commented Jul 25, 2014

I would add a note about python version early on. It it would be accepted, I would write a PR to add portability. At the very least, make some noise about using py2 and crashing-out explicitly

@programetica

This comment has been minimized.

Show comment
Hide comment
@programetica

programetica Jul 28, 2014

Thanks Isaac! This is the gift that keeps on giving (for four years now, apparently). I just ran the top scripts on Ubuntu (Lubuntu) 14.04 Trusty and it ran perfectly and quickly, I just had to install Curl before step #6.

programetica commented Jul 28, 2014

Thanks Isaac! This is the gift that keeps on giving (for four years now, apparently). I just ran the top scripts on Ubuntu (Lubuntu) 14.04 Trusty and it ran perfectly and quickly, I just had to install Curl before step #6.

@SamuelMarks

This comment has been minimized.

Show comment
Hide comment
@SamuelMarks

SamuelMarks Aug 12, 2014

Neatest method I've found:

$ mkdir ~/.nave && cd $_ && wget http://github.com/isaacs/nave/raw/master/nave.sh
$ sudo ln -s $PWD/nave.sh /usr/local/bin/nave
$ chmod +x nave
$ nave use 0.10.30  # Or whatever other version you want
$ npm update -g npm

SamuelMarks commented Aug 12, 2014

Neatest method I've found:

$ mkdir ~/.nave && cd $_ && wget http://github.com/isaacs/nave/raw/master/nave.sh
$ sudo ln -s $PWD/nave.sh /usr/local/bin/nave
$ chmod +x nave
$ nave use 0.10.30  # Or whatever other version you want
$ npm update -g npm
@reinaldoferreira

This comment has been minimized.

Show comment
Hide comment
@reinaldoferreira

reinaldoferreira Aug 14, 2014

Hey man, thanks!! The first one worked for me!
Really, thanks, i have been suffering with permission errors 48 hours ago and now every thinks works fine!

reinaldoferreira commented Aug 14, 2014

Hey man, thanks!! The first one worked for me!
Really, thanks, i have been suffering with permission errors 48 hours ago and now every thinks works fine!

@ptica

This comment has been minimized.

Show comment
Hide comment
@ptica

ptica Aug 15, 2014

re: node-and-npm-in-30-seconds.sh

curl https://www.npmjs.org/install.sh | sh

resulted in

curl: (51) SSL: certificate subject name 'a.sni.fastly.net' does not match target host name 'www.npmjs.org'

seems that npm is part of node so is there still need for it? as even without it I got:

which npm
~/local/bin/npm

ptica commented Aug 15, 2014

re: node-and-npm-in-30-seconds.sh

curl https://www.npmjs.org/install.sh | sh

resulted in

curl: (51) SSL: certificate subject name 'a.sni.fastly.net' does not match target host name 'www.npmjs.org'

seems that npm is part of node so is there still need for it? as even without it I got:

which npm
~/local/bin/npm
@GatorDigital-HQ

This comment has been minimized.

Show comment
Hide comment
@GatorDigital-HQ

GatorDigital-HQ Sep 17, 2014

Tried the first method and it failed reporting syntax errors in ./configure

GatorDigital-HQ commented Sep 17, 2014

Tried the first method and it failed reporting syntax errors in ./configure

@he7d3r

This comment has been minimized.

Show comment
Hide comment
@ashleyblackmore

This comment has been minimized.

Show comment
Hide comment
@ashleyblackmore

ashleyblackmore Sep 30, 2014

@harleyhar you are probably using wrong python to install. instead of py3k try:

python2.7 configure --prefix=~/local

for me, that fixed the issue you seemed to be having

ashleyblackmore commented Sep 30, 2014

@harleyhar you are probably using wrong python to install. instead of py3k try:

python2.7 configure --prefix=~/local

for me, that fixed the issue you seemed to be having

@odonohueben

This comment has been minimized.

Show comment
Hide comment
@odonohueben

odonohueben Oct 20, 2014

I installed node-and-npm-in-30-seconds.sh with success:

BENs-MacBook-Air:~ benodonohue$ ls
Applications Dropbox Pictures
Desktop Library Public
Documents Movies local
Downloads Music node-latest-install

I get this when i run npm -v:
BENs-MacBook-Air:~ benodonohue$ npm -v
-bash: npm: command not found

Is someone able to tell me what i may have done or doing wrong?

UPDATE:
I used twincharged solution shown above, now its working. I ran,
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bash_profile

Thanks..

odonohueben commented Oct 20, 2014

I installed node-and-npm-in-30-seconds.sh with success:

BENs-MacBook-Air:~ benodonohue$ ls
Applications Dropbox Pictures
Desktop Library Public
Documents Movies local
Downloads Music node-latest-install

I get this when i run npm -v:
BENs-MacBook-Air:~ benodonohue$ npm -v
-bash: npm: command not found

Is someone able to tell me what i may have done or doing wrong?

UPDATE:
I used twincharged solution shown above, now its working. I ran,
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bash_profile

Thanks..

@newshorts

This comment has been minimized.

Show comment
Hide comment
@newshorts

newshorts Oct 27, 2014

I made a slight revision to this here for homebrew:

# using Homebrew

# Note: `brew install npm` has problems, as of 2010-12-30.
# hopefully it will eventually be good and happy.
# As of npm@0.2.13, however, this is an option

PREFIX=$(brew --prefix)

# take ownership
# this will also let homebrew work without using sudo
# please don't do this if you don't know what it does!
sudo mkdir -p $PREFIX/{share/man,bin,lib/node,include/node}
sudo chown -R $USER $PREFIX/{share/man,bin,lib/node,lib/node_modules,include/node}

brew install node

# now install npm
# prefix will default to $(brew --prefix)
curl https://www.npmjs.org/install.sh | sh

newshorts commented Oct 27, 2014

I made a slight revision to this here for homebrew:

# using Homebrew

# Note: `brew install npm` has problems, as of 2010-12-30.
# hopefully it will eventually be good and happy.
# As of npm@0.2.13, however, this is an option

PREFIX=$(brew --prefix)

# take ownership
# this will also let homebrew work without using sudo
# please don't do this if you don't know what it does!
sudo mkdir -p $PREFIX/{share/man,bin,lib/node,include/node}
sudo chown -R $USER $PREFIX/{share/man,bin,lib/node,lib/node_modules,include/node}

brew install node

# now install npm
# prefix will default to $(brew --prefix)
curl https://www.npmjs.org/install.sh | sh
@djavaui

This comment has been minimized.

Show comment
Hide comment
@djavaui

djavaui Nov 17, 2014

WONDERFULL!!!

djavaui commented Nov 17, 2014

WONDERFULL!!!

@Wail75

This comment has been minimized.

Show comment
Hide comment
@Wail75

Wail75 Dec 8, 2014

Hello,

I tried to install Semantic UI using the git only method. I went through the installation and after "npm install" (