| 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 |
| # 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 |
optikfluffel
commented
Oct 18, 2010
|
For me the 2nd one worked ^^ thx |
joar
commented
Nov 12, 2010
|
First one worked perfectly, although on a Debian x64 512M RAM it did not perform in 30 seconds.
HAH! NEVERMIND! Didn't work, Edit: I retried after I cleaned up some node-related directories, binaries and installs. I uninstalled The self-compiled |
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
commented
Dec 13, 2010
|
seems like someone is keeping ports up to date as well... |
RobertStewart
commented
Dec 26, 2010
|
For the take-ownership script, you first need to create /usr/local/lib/node and /usr/local/include/node.
|
|
Thanks, Robert, good catch. Fixed. |
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
commented
Jan 4, 2011
|
ok..cool. |
chadams
commented
Jan 7, 2011
|
If your on a MAC remember your ".bashrc" isn't used, it should be ".bash_profile" |
maxidr
commented
Jan 29, 2011
|
Thanks for share!! good work! |
rbotman
commented
Mar 11, 2011
|
For the only-git-all-the-way script, the location of node.git should be updated: |
|
@rbotman: Thanks. |
TrevorBurnham
commented
Mar 22, 2011
|
There's a reference to |
d2s
commented
Mar 26, 2011
|
There is one quite nasty error in only-git-all-the-way.sh example: There should be |
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
commented
Mar 28, 2011
|
Help !! Also if I try the git all the way i get this |
|
I have observed this as well. Cygwin is really terrible in how it
handles child processes. There is basically no way around this.
You can try `curl http://npmjs.org/install.sh | npm_install=rc sh` to
install the 1.0 release candidate, which handles Cygwin a little
better. But, really, the best answer is to either wait for a native
windows port of node, or use use something like VMWare or VirtualBox
to run an Ubuntu virtual machine.
|
devlim
commented
Apr 14, 2011
|
May i know how to upgrade node.js? just run the same command again? |
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
commented
Apr 14, 2011
|
Thank DTrejo. |
brandondrew
commented
Apr 25, 2011
|
What is the rationale for installing to ~/local in so many of these? |
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. |
|
Some more info here:
http://blog.nodejs.org/2011/04/04/development-environment/
|
|
@brandondrew The point is that software you install and develop
should go somewhere you own and manage.
I install node and npm into /usr/local on my mac. I also have
chown'ed that directory to my user account. On servers and other
"production" machines that I'm not as intimate with, I install
everything into ~/local.
There are two points at work here:
1. Don't do things you don't understand, or clobber things that aren't yours.
2. Try very hard not to destroy your ability to revert to a "clean" environment.
If you install into /usr/local, you can always revert to the initial
state by removing that directory (and with it, all the user-installed
software). The system stuff will be in the base of /usr (or even the
top-level /lib, /var, etc.)
If you install into your home directory, you have only to log in as a
different user to see a pristine environment.
I recommend installing into your home directory if you aren't 100%
clear about what's going on in /usr/local, and comfortable manually
managing it.
…
|
vkelman
commented
May 3, 2011
|
I'm getting the same error as edlongman trying to run |
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
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
commented
May 6, 2011
|
When I did the install as superuser (take-ownership) route I got an error: anyone have any ideas? |
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 |
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
commented
May 26, 2011
|
Please fix only-git-all-the-way.sh as per the above comment. |
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
commented
Jul 4, 2011
|
Hi i've got such problem with npm on ubuntu 11.04: 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 installMaybe anyone could help me: what if i want to install node.js to /media/lazersluts/nodejs, what should i do. Update Solved with echo prefix = ~/local >> ~/.npmrc
curl http://npmjs.org/install.sh | sh |
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
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
commented
Aug 29, 2011
|
In Ubuntu, you may need to do |
Ginny
commented
Aug 30, 2011
|
'install' finished successfully (12m33.358s) |
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/ |
ianswilliams
commented
Oct 2, 2011
|
Thankyou, my node/npm install got corrupted "somehow" , the first method about worked for me |
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 Written by John Gilmore and Jay Fenlason. If I try the second, and run make install it seems to run forever at buid-doc.sh. |
clintandrewhall
commented
Nov 7, 2011
|
I had to add:
before line 10 in order for https://gist.github.com/579814#file_use_nave.sh to work properly. Did I miss something? |
snapshot
commented
Nov 18, 2011
|
I am trying to install this using homebrew and I seeing the following permissions error.
It looks like the install for npm is failing: To get this working I added
I probably could also have run it the install command with sudo like this:
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
commented
Nov 29, 2011
|
http://nodejs.org/dist/node-latest.tar.gz - 404 not found |
designerfuzzi
commented
Dec 1, 2011
|
which node.js version is the latest who support i386 MacOSX 10.5.8 ? |
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
commented
Jan 30, 2012
|
top one worked great for me on Ubuntu Server 11.04. thanks! |
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’: |
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 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
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
commented
Nov 16, 2012
|
Running Ubuntu 12.04, I kept running into this error when running
My vm was brand spanking new, so I had to install this before
|
andremendesc
commented
Jan 22, 2013
|
Just used the first one at Amazon EC2, awesome, thanks. |
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. npm ERR! System Linux 3.5.0-27-generic
make: Nothing to be done for `doc'. npm ERR! System Linux 3.5.0-27-generic |
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 ~ No error messages so apparently it worked :) |
JLMorales
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
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 |
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 |
francisbyrne
commented
Jun 19, 2013
|
Nevermind, looks like I was using an old Python version: |
ghost
commented
Jun 27, 2013
|
Worked here. Ubuntu 13.04 64 bits. Thanks :) |
symsun
commented
Jun 28, 2013
|
First one is not working for me also. Someone pls help. [root@sddev node-latest-install]# ./configure --prefix=~/local |
zweiland
commented
Jul 2, 2013
|
top worked beautifully! thanks man! |
Jerbot
commented
Jul 5, 2013
|
Step 9, method 1: "npm cannot be installed without nodejs. "Maybe node is installed, but not in the PATH? |
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 |
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
commented
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
|
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
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
commented
Aug 29, 2013
|
./configure --prefix= ./configure --prefix=$HOME/local |
modi2020
commented
Sep 6, 2013
|
I love this.....works like charm Thank you so much! |
kereg
commented
Oct 2, 2013
|
Thanks!! No 30 seconds here.... |
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
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
commented
Oct 19, 2013
|
node-and-npm-in-30-seconds.sh ftw \m/ thank you so much! |
SgtPooki
commented
Oct 20, 2013
|
@leto, ./configure --prefix=$home/local fixed the issues I was having with #2. Thanks! |
valtonio
commented
Oct 29, 2013
|
The first one doesn't work on OSX 10.9. |
billstron
commented
Nov 2, 2013
|
Actually, the problems with #2 are fixed with |
michael-yin
commented
Nov 3, 2013
|
Thank you very much..I have installed node in ubuntu. |
johanbaaij
commented
Nov 17, 2013
|
I'm also getting this with the 30 second method. "npm cannot be installed without nodejs. Maybe node is installed, but not in the PATH? 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
commented
Nov 17, 2013
|
@johan010 npm comes packaged with nodejs now so you can ignore the part about installing npm |
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
commented
Dec 2, 2013
|
Wow - wish i'd found this page like a year ago. :) stackoverflow answer is crap. |
meeb0
commented
Dec 5, 2013
|
Wonderful... |
janraasch
commented
Dec 22, 2013
|
This is beautiful. |
firstdoit
commented
Jan 6, 2014
|
In addition to the first script, I run this on new systems for easy sudo'ing, when (rarely) needed:
|
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 |
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
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
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: ... Do you have any idea what can cause this? |
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'... |
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
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.shThe solution is to either manually change for the redirect curl -v https://www.npmjs.org/install.shOr just use the -L option to tell curl to follow redirects curl -Lv https://www.npmjs.org/install.shAfter making one of those changes, the gists should work. |
|
Just updated the scripts to add the www to the urls. Sorry about that, folks. |
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 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] can I add it like ~/local/lib ?? |
fritx
commented
Mar 22, 2014
|
The link http://joyeur.com/2010/12/10/installing-node-and-npm/ is not active now. |
faviouz
commented
Mar 23, 2014
|
That link is now https://www.joyent.com/blog/installing-node-and-npm |
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: But I would grateful if someone could explain why the tilde did not work. |
anthonybrown
commented
Apr 2, 2014
|
The homebrew install should be |
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
commented
Apr 19, 2014
|
First method worked, even thought it took a lot more than 30 seconds. Thanks. |
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
commented
May 7, 2014
|
I installed nave like
Permission denied? Huh. It has all the correct permissions in /usr/local/bin:
but I can run nave with I'm using Ubuntu 14.04 and ZSH here. Any clues? |
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
commented
May 31, 2014
|
Note for anyone having trouble with installing/using node and or npm (especially after restarting the terminal) - For me the |
twlkyao
commented
Jun 7, 2014
|
I use the second, and it works. |
renoth
commented
Jun 10, 2014
|
the last one ... piping curl into your shell ... this is clearly a joke isnt it? |
01010000101001100
commented
Jun 11, 2014
|
Should I go with this one or noob-node-package-installer? :D |
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
commented
Jun 21, 2014
|
Regarding
Thanks! |
e-oz
commented
Jun 23, 2014
|
@mkalygin you should never use sudo for npm installation. http://stackoverflow.com/questions/18212175/npm-yo-keeps-asking-for-sudo-permission/18277225#18277225 |
petterg
commented
Jun 29, 2014
|
On my gentoo system I get: export PYTHON=/usr/bin/python2.7 ../../src/weak_collection.js ../../src/promise.js ../../src/object-observe.js ../../src/macros.py It seems like something does not honor the $PYTHON setting and is just calling "python" which gives python3 and the above error |
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
tar -zxvf node* |
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:
|
justjoolz
commented
Jul 14, 2014
|
First one gave me these errors: npm ERR! Error: EACCES, mkdir '/usr/local/share/man/man1' npm ERR! System Linux 3.13.0-24-generic |
mryellow
commented
Jul 21, 2014
|
Git, path problem.
Following the instructions it's actually installed to |
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 |
holodny
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
commented
Aug 12, 2014
|
Neatest method I've found:
|
reinaldoferreira
commented
Aug 14, 2014
|
Hey man, thanks!! The first one worked for me! |
ptica
commented
Aug 15, 2014
re: node-and-npm-in-30-seconds.sh
resulted in
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
commented
Sep 17, 2014
|
Tried the first method and it failed reporting syntax errors in ./configure |
he7d3r
commented
Sep 25, 2014
|
The link |
ashleyblackmore
commented
Sep 30, 2014
|
@harleyhar you are probably using wrong python to install. instead of py3k try:
for me, that fixed the issue you seemed to be having |
odonohueben
commented
Oct 20, 2014
|
I installed node-and-npm-in-30-seconds.sh with success: BENs-MacBook-Air:~ benodonohue$ ls I get this when i run npm -v: Is someone able to tell me what i may have done or doing wrong? UPDATE: Thanks.. |
newshorts
commented
Oct 27, 2014
|
I made a slight revision to this here for homebrew:
|
djavaui
commented
Nov 17, 2014
|
WONDERFULL!!! |
Wail75
commented
Dec 8, 2014
|
Hello, I tried to install Semantic UI using the git only method. I went through the installation and after "npm install" ( http://learnsemantic.com/guide/expert.html#project-dependencies ) I got an error about gulp version. Then I tried to update gulp with npm and got an error message saying that node version is not correct (sorry I lost the messages and I don't remember version numbers). |
SteveShaffer
commented
Dec 12, 2014
|
I tried the second one, and it ended up creating a literal " Changing to --prefix=/home/username/local seems to fix it. But that's weird... |
cristovaov
commented
Dec 12, 2014
|
I received an error today installing 'node-and-npm-in-30-seconds.sh' in my Vagrant provision with the npm part which was not happening last week. Using 'curl -L https://npmjs.org/install.sh | sh' instead (as suggested on npmjs.com) resolved my problem. Cheers~ |
starsinmypockets
commented
Dec 18, 2014
|
tl;dr - any reason not to just grab the binary? |
mikejerome
commented
Dec 18, 2014
|
I had the same problem and solution as cristovaov |
justcookin
commented
Dec 24, 2014
|
Had the same problem as cristovaov - curl -L https://www.npmjs.org/install.sh | sh (added -L to follow redirect) worked. |
ghost
commented
Dec 26, 2014
|
@isaacs, all of the scripts should have |
easingthemes
commented
Jan 1, 2015
|
Thanks,
|
AndersSchmidtHansen
commented
Jan 3, 2015
|
Thanks for the gists, I've used the 'node-and-npm-in-30-seconds.sh' plenty of times with success. I do agree with easingthemes and Aedx that @isaacs should update the code with the up-to-date curl. For what it's worth, if you are on a completely fresh install of ElementaryOS you might need to install g++ make first. I could get any of @isaacs scripts to work when I first tried (a while back) and had to do:
After that, the 30 second method worked smoothly (when remembering |
RobinIsTheBird
commented
Jan 3, 2015
|
Thanks, this is great. Great success with 'node-and-npm-in-30-seconds.sh'. FWIW, |
ezmiller
commented
Jan 9, 2015
|
using these methods, how does one then update node? i tried to install n using npm and it didn't seem to work. when i issued the command |
danielfoxp2
commented
Jan 12, 2015
|
Thanks. I ran into some problems using sudo to install node and find here some good options to do it without sudo nor need to change /usr/local permissions. But, I was wondering why the command "curl https://www.npmjs.org/install.sh | sh" is needed. I chose the "xgd-freedesktop.org-style.sh" option and put line by line in terminal. But, after the "make install" command I tested if node was ok and it worked like a charm, then, by curiosity, I tested if npm was already installed together, because npm now come with node installer, and yes, npm was installed and fully functional. So, the question is: Why run the "curl https://www.npmjs.org/install.sh | sh" command is required? p.s.: Sorry about my english, I am a huehuebr... |
gavinengel
commented
Jan 21, 2015
|
This should be changed: https://www.npmjs.org/install.sh
|
troyhart
commented
Jan 31, 2015
|
I used I replaced this with an explicit path and it seemed to work. Specifically, I did this: git clone git://github.com/joyent/node.git
cd node
./configure --prefix=/home/myusername/local
make install |
dpelletier
commented
Feb 10, 2015
|
Much to my great frustration, nowhere, could I really find a complete and concise method of installing the full node stack that did not involve using sudo or some drawn out tedious, solution (and neither the official node site or stackexchange helped here).... As well, all of the sites I visited said that npm was included with the nodejs module yet the nodejs version existing in the default Ubuntu repository did not seem to have it. To save others similar frustrations, I thought I would sketch out the steps I took to install the nodejs stack onto Ubuntu 12.04, "Precise" (elementary): Also, since nvm uses the name "node" instead of "nodejs", make sure that the unrelated program also named "node" -- the Amateur Packet Radio -- does not already exist on your system. sudo apt-get install git build-essential libssl-dev curl git-core wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash (I determined the latest nvm version available -- and a lot of other, really helpful information -- at: https://github.com/creationix/nvm) To have nvm automatically sourced, accessible at login: vi ~/.bashrc Now, as root (of course): nvm install stable To set a default version to be used in any new shell, use the alias 'default': Notice that nvm installs everything to the ~/.nvm directory (circumventing the usual requirement and inherent danger of requiring sudo to be used for installing nodejs and its scripts): And if you want Ionic to be installed as well, as I did: |
deesejohn
commented
Feb 17, 2015
|
Debian Sid user here, used the first script with two changes
To
as well as added -L to
|
matheuslc
commented
Feb 19, 2015
|
@deesejohn Thank you very much! |
mysolbbb
commented
Feb 19, 2015
|
Hi npm install gave me these errors: npm ERR! install Couldn't read dependencies npm ERR! System Linux 3.2.0-68-virtual |
jjssoftware
commented
Feb 28, 2015
|
Linux Mint 17 here. The first method almost worked as-is for me except the path added to .bashrc in line#1 wasn't quite right so when attempting to start node at the CLI I was getting the following message echoed back:
So in my home directory I edited .bashrc:
..and changed the line that contained: After that I was able to |
0800robin
commented
Mar 2, 2015
|
Top one worked wonders for me. |
smmoosavi
commented
Mar 5, 2015
|
Simplest way:
|
firecentaur
commented
Mar 9, 2015
|
Thank you for this, the top one worked for me! |
firecentaur
commented
Mar 9, 2015
|
oh, by the way, for #1, the curl url is wrong, instead use: curl https://raw.githubusercontent.com/creationix/nvm/v0.24.0/install.sh | bash |
Jakobud
commented
Mar 26, 2015
Should be changed to
|
McQuinTrix
commented
Mar 28, 2015
|
forgive my ignorance, but i don't understand how to use this, can help ?(: my OS is Fedora 21(: |
jackhickey
commented
Mar 28, 2015
|
Having spent 2 hours trying to get node/npm working properly in elm OS, I found this, used the top one.. everything working perfectly now. Thank you very very much! |
gitjeff05
commented
Mar 30, 2015
|
Having trouble getting the first option to work. Maybe it would help if there were some explanation about what these commands do? what does the second line My guess is that these are trying to install into ~/local and that's why you place that in the path. If so, that did not work for me. I had to put |
tchalvak
commented
Mar 31, 2015
|
As Jakobud says, the install url for npm has moved permanently from npmjs.org to npmjs.com |
monsteronfire
commented
Apr 6, 2015
|
I tried the first method and kept getting stuck. Then yesterday I tried the second method (git-all-the-way) and it managed to work with a few modifications. Made a gist if anybody else wants to see: https://gist.github.com/monsteronfire/adcfd633aa78cfb72c60#file-node-npm-no-sudo |
stanusk
commented
Apr 8, 2015
|
The first version did not work until I read post by gitjeff05 and added: As for the npm, this worked: |
csullivan
commented
Apr 11, 2015
|
Just needed to compile node, so the first option worked easy enough. Thank you! |
yairEO
commented
Apr 19, 2015
|
link at the top is dead: http://joyeur.com/2010/12/10/installing-node-and-npm/ |
VerbGarden
commented
Apr 21, 2015
|
@leto Using ./configure --prefix=$HOME/local per your suggestion helped OOTB Ubuntu 14.04 with method #1. |
jvkumar
commented
Apr 22, 2015
|
@isaacs , i could not get very first solution node-and-npm-in-30-seconds.sh work. And it ran over a minute and did bunch of stuff. Can you tell me how to clean and undo whatever this would have done? |
schoetbi
commented
May 4, 2015
|
I would suggest to have -j 8 as a command line argument for all make instantiations in all scripts. It does not hurt as far as I know. |
timfenney
commented
May 4, 2015
|
On the "30 second" version (1st) I get: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance Installing Xcode shouldn't be a prerequisite to the "quick'n'dirty" solution IMHO |
easingthemes
commented
May 6, 2015
|
Long time ago I used "30 sec" version and it served me fine.
Thanks again. |
anchetaWern
commented
May 7, 2015
|
if you installed node with nvm, this also works:
|
iainwatt
commented
May 20, 2015
|
I installed using git all the way and this works (so far) but only in one terminal window, if I open a second window i get the classic |
cazzoo
commented
May 23, 2015
|
Yet the first script does not work on all distribs. |
FeSantos
commented
May 24, 2015
|
I use the first and worked for me! Thanks a lot.. |
Toosman
commented
May 27, 2015
|
@cazzoo Thank you. I'm running Debian 7 and the PATH setup didn't work (i couldn't just execute #node anywhere) but with your tip it works. |
laurencefass
commented
Jun 4, 2015
|
i'm trying the first script but after executing (with no errors) the node-latest-install exists but the node command does nothing. i cant see any executable anywhere in the folder tree. do i need to add something to /bin somewhere. thanks. |
sriharrsha
commented
Jun 10, 2015
|
mysolbb I had the same error the thing is you have to install as root first step :sudo su |
shijukbabu
commented
Jun 25, 2015
|
I tried the first script. The last one didn't work. It showed curl https://www.npmjs.org/install.sh | sh So I tried following (I got from here http://stackoverflow.com/a/15508817/2353403 ) But it's showing the error. node is not found npm cannot be installed without node.js. Maybe node is installed, but not in the PATH? PATH=/home/myuser/local/bin:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-7-oracle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games |
dcondrey
commented
Jun 25, 2015
|
c9jester
commented
Jul 6, 2015
|
For the top script, I had to change the following:
to
and
to
Everything else worked fine. Ubuntu Server 14.04.2 LTS |
tkanapar
commented
Jul 6, 2015
|
In the script we need to change https://www.npmjs.org/install.sh to https://www.npmjs.com/install.sh. |
wltiii
commented
Jul 17, 2015
|
For script node-and-npm-in-30-seconds.sh, I found the same issue as c9jsester. The original configure prefix argument just shoved everything in a sub folder named ~ in the ~/node-latest-install directory. Not sure why that failed. I actually split the curl command and install command:
Running on Linux Mint 17. |
kuzeko
commented
Jul 19, 2015
|
Same problem as c9jsester and wltiii. |
simonbcn
commented
Aug 5, 2015
simonbcn
commented
Aug 5, 2015
|
The third option is an aberration on Linux and a security breach. |
simonbcn
commented
Aug 5, 2015
|
Finally I've installed it with NVM. I think is the easiest and working option. |
h02e56
commented
Aug 30, 2015
|
After remove all my spreaded npm modules Option 4 works for me, not using wget.(MacOS) |
ogrotten
commented
Oct 9, 2015
|
I suppose these are great for a fresh setup, but what about if I already have a bunch of shit installed? COMPLETE AND TRUE SOLUTION |
timeflying
commented
Oct 18, 2015
|
node-and-npm-in-30-seconds.sh |
bahrmichael
commented
Dec 2, 2015
|
In |
nick3499
commented
Dec 20, 2015
|
Add parameter to |
itsazzad
commented
Dec 31, 2015
|
|
adhorrig
commented
Jan 13, 2016
|
node-and-npm-in-30-seconds.sh took roughly an hour and five minutes using Ubuntu v14.04.03 |
JGSolutions
commented
Jan 16, 2016
|
Same here take over 30 mins to install and stopped the build |
neophoenix123
commented
Jan 19, 2016
|
Hello, I am a very new user to this and have failed my machine many times trying to set up the ember-cli environment properly. In the first assembly you have (create in 30 seconds) do I use the commands verbatim or is there other content I need to include on my own somewhere? Ex. do I need to add a dir path when typing ~/.bashrc? Again forgive me I am a total green pea here so thank you for the time! |
SeAlgoAsoma
commented
Jan 24, 2016
|
Said already but apparently ignored: Node is now at https://github.com/nodejs/node, not the repo given in the code. Updating it to save guys like me 20 minutes of hairpulling would be a kindness. |
SeAlgoAsoma
commented
Jan 24, 2016
|
Well, this has been a fun use of an hour that could have been spent on something productive.
If it's 2016 or later, and you're on Bluehost, I hope you see this comment before you spent any time on this. Don't bother. None of these methods work anymore on Bluehost. |
magick93
commented
Jan 28, 2016
|
None of the above methods worked: node-and-npm-in-30-seconds.shsh: 1: Moved: not found only-git-all-the-way.shanton@Charles:~/Documents/software/node$ ./only-git-all-the-way.sh take-ownership.shanton@Charles:~/Documents/software/node$ ./take-ownership.sh yet-another-option.shanton@Charles:~/Documents/software$ ./yet-another-option.sh For a much easier method see http://www.competa.com/blog/2015/10/use-nvm-for-fun-and-profit-and-to-run-npm-without-sudo/ |
kauffj
commented
Mar 15, 2016
|
It looks like |
cablegunmaster
commented
Mar 22, 2016
node and npm installationI just tried this, the last command didn't work.
saying: file location not found. @magick93 After some searching:
is the solution to your first installation if you still need it. |
ed-davies
commented
Apr 4, 2016
|
sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node} This is a rather bad idea. One of the minor ways in which Linux security is less bad than that of Windows is that normally you don't have write access to any directories on your $PATH so it's harder for any exploit which can write arbitrary files to get them executed. To execute something not on the path you have to give the directory explicitly (e.g. “./a.out” rather than just “a.out”) which happens less often and is usually well controlled. By opening up /usr/local/bin to writes by any software you use you make your system a tiny bit more vulnerable. I wonder if installing npm as its own user (say, “npm”) would be the best solution. To install something you'd use “ssh npm@localhost npm install --global some_package”. With the right prefix set up all uses of the packages could proceed as currently. Including it in the path for command line packages would be possible though ~npm/(bin|lib?)/command wouldn't be too terrible to type. |
BellAppLab
commented
Jun 23, 2016
|
For posterity (since it took me a while to figure this one out). If, while running the first script, you come across an error similar to this one:
You might want to check if your system has a swap file set up. |
BellAppLab
commented
Jun 23, 2016
|
And you might want to replace the last line with:
|
ankurk91
commented
Aug 24, 2016
|
Install node-js using nvm |
shashanthk
commented
Sep 18, 2016
|
BellAppLab, your suggestion worked for me. And it's super easy. Thank you... |
shadiakiki1986
commented
Sep 24, 2016
|
Using nvm was much easier and faster:
... done in 30 seconds and installed node 6.6 |
ashrih
commented
Oct 17, 2016
|
i have Q about the mocha test, i have done the first step but my Q is are mocha going to test all the files ? |
bw2
commented
Dec 16, 2016
|
thanks @shadiakiki1986 |
sdahlkjsdgh
commented
Dec 17, 2016
|
Cheers, this really helped me with my new nutrition blog. |
dimkk
commented
Jan 20, 2017
|
Thanks! |
ORESoftware
commented
Mar 17, 2017
|
As of March 2017, which methodology is the best? My use case is bizarre. We have an OpenStack prod server that's only on Node 0.10. We have like no permissions on the prod server except one directory where our code goes. So literally going to try to put the latest node version in our project, desperate times desperate measures. LOL. |
Masoudkhalili
commented
Apr 11, 2017
|
hello guys i installed Laravel 5 Simple CMS but when i open browser i receive this error QueryException in Connection.php line 647: |
dandv
commented
Jun 14, 2017
|
Hey everyone, newsflash: GitHub doesn't send notification email for gists! So it's nice and all to say Thanks and ask questions, but don't be surprised that isaacs hasn't replied since 2014. |
Magarusu
commented
Jul 6, 2017
|
Hi, I needed to install an older version of node and I did
Does anyone know how I could install an older version of npm to work with node? |
tbone849
commented
Oct 5, 2017
|
@shadiakiki1986 Thank you. Worked perfect.
Worked on Bluehost as of 10/5/17. |
rodgerpaulo
commented
Oct 18, 2017
|
First option worket fine to me <3 |
sethbergman
commented
Oct 27, 2017
curl -L https://git.io/n-install | bashThis is by far the simplest way to get started with both
See examples below, and Installing n for prerequisites and installation options. ExamplesSee Installation options for details.
curl -L https://git.io/n-install | bash
curl -L https://git.io/n-install | bash -s -- -y
curl -sL https://git.io/n-install | bash -s -- -q
curl -L https://git.io/n-install | bash -s -- -y lts 0.10
curl -L https://git.io/n-install | N_PREFIX=~/util/n bash -s -- -yInstalling nSupported platforms and prerequisites Among the platforms supported by |
eltrhn
commented
Dec 19, 2017
•
|
@isaacs - The GitHub links for NodeJS and npm should be edited respectively to |
missxu
commented
Dec 21, 2017
•
|
This is awesome - exactly what I was looking for. I used option one ('cause I'm lazy and wanted to get on to the hacking) - for those on OSX, install XCode first. Also, I ended up getting a 301 Moved Permanently error but I just did subbed in:
and now it looks like I'm gtg. |
madurimanoj
commented
Jan 12, 2018
•
|
@isaacs the second one works, if your macbook/iMAc doesn't allow the git clone just download the zip of node/npm and you can do the remaining from the downloads itself. It works, Thanks. |

DTrejo commentedOct 3, 2010
Used the top one, and it worked great. Thanks :)