Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've found a few different methods on the web, but some of the articles are quite old, and I'm concerned that the methods they describe have been superceded.

Can anyone tell me what the currently recommended method, to best utilise package management etc?

share|improve this question
add comment

5 Answers 5

The official node.js github page has a rundown for all distros, Debian included. They recommend installing from source:

apt-get install python g++ wget libssl-dev
mkdir /tmp/nodejs && cd /tmp/nodejs
wget http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
make
make test
make install

Remember that installing from source will definitely get you the latest software, however sometimes it is more difficult to uninstall all files attached to a specific project. In order to avoid this, use checkinstall to build yourself a quick package.

I was able to build a .deb package on Ubuntu by following the guide here. This should probably also work for Debian too ;-)

share|improve this answer
1  
Dead link :( - used to be like this web.archive.org/web/20120702211840/http://apptob.org –  Magnetic_dud Nov 4 '13 at 12:18
    
Thanks for noticing that! I've changed the link to the archived version. (kinda funny that the site presently at that domain is all about dating... "To build a .deb package just follow this guide on how to notice if your partner is cheating on you" o_0) –  TrinitronX Nov 4 '13 at 22:28
add comment

You can install node.js through apt-get.

# echo deb http://ftp.us.debian.org/debian/ sid main > /etc/apt/sources.list.d/sid.list
# apt-get update
# apt-get install nodejs
share|improve this answer
3  
Should be said that mixing repositories of different Debian versions can lead to problems, that the user should be ready to face. –  enzotib Apr 4 '12 at 12:02
    
mixing repositories not lead to huge problem, but contain some version compatibility issues –  Mughil Apr 4 '12 at 12:56
    
Ok thanks - this will install from the unstable release, right? Is that not a problem? –  UpTheCreek Apr 4 '12 at 16:00
add comment

You can avoid mixing Debian versions (a recipe for pain!) by building your own .debs

https://github.com/mark-webster/node-debian

You can build .deb files for arbitrary versions of node.js, so you can install / upgrade / uninstall it easily. It's a bit quick and dirty, but at least it's something until the official Debian packages arrive in stable.

share|improve this answer
    
This package install npm too. Bytheway this is clean solution –  b1- Dec 29 '13 at 20:05
add comment

Node.js is available in official repo for Debian Sid and Jessie.

sudo apt-get install nodejs

If you don't have it in your main repository (the command didn't work), I'd recommend building from source, this way:

sudo apt-get install python g++ make checkinstall
mkdir ~/src && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
checkinstall   #remove the "v" in front of the version number in the dialog!
sudo dpkg -i node_*

Uninstall:

sudo dpkg -r node

In case you get a permission denied on the node executable, an alternative path might be:

umask 0022
./configure
make
checkinstall -D --umask 0022 --reset-uids --install=no
dpkg -i node_*.deb
share|improve this answer
add comment

To get the latest stable Node, you can install it from the package manager, then update it using npm:

sudo apt-get install nodejs npm 
sudo npm update -g

This to be the simplest way of getting the latest version without expending too much effort.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.