Hello Sekati.

 Hello. I make things.


Install Node.js on Debian Squeeze

Recently I began a few Node.js projects which I roll micro VM guests to sandbox my experiments on. Unfortunately there are not maintained APT packages for Node or NPM on Squeeze. I decided since most information out there for Node/NPM installation on Debian/Ubuntu is a bit dated I’d document the quick/easy steps I used for my machine image:

Install dependency packages

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

Install Node.js & NPM

git clone https://github.com/joyent/node.git
cd node

# 'git tag' shows all available versions: select the latest stable.
git checkout v0.6.8

# Configure seems not to find libssl by default so we give it an explicit pointer.
# Optionally: you can isolate node by adding --prefix=/opt/node
./configure --openssl-libpath=/usr/lib/ssl
make test
sudo make install
node -v # it's alive!

# Lucky us: NPM is packaged with Node.js source so this is now installed too
# curl http://npmjs.org/install.sh | sudo sh
npm -v # it's alive!

That’s it; not rocket science but there are many install paths & given the rapid development cycle of Node it’s really best to be building from source at this point; hopefully this will save you a few cycles.

Date: January 21, 2012
Category: /etc/
Tags: # # #

43 Responses

  1. Joel

    February 18th, 2012 @ 12:42 am

    Thanks, this worked perfectly.

  2. Yoyo

    February 18th, 2012 @ 7:45 am

    Worked fine for my debian, thanks ;]

  3. Michael Watts

    March 16th, 2012 @ 6:07 pm

    I couldn’t get my Debian to install build-essential package – for some reason. I had updated, and upgraded but instead managed to get it working by running apt-get make, apt-get gcc g++ (I think) and apt-get dpkg (+ dpkg-dev). Just in case anybody else has similar prob, this seems to have worked so far.

    Many thanks for some great instructions.

  4. jason

    March 18th, 2012 @ 11:15 pm

    My pleasure! As for missing build-essential, this maybe due to some missing /etc/apt/sources.list perhaps; Debian’s a bit paranoid on the licensing of shipped packages – you can expand this by adding `contrib` & `non-free` to your sources.list, e.g:

    deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
    deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

  5. dan

    April 4th, 2012 @ 11:20 am

    Thank you so much for this guide! At first, I followed some other guide, editing the /etc/apt/sources.list to include SID packages…
    I ended up resetting by server…
    Your guide worked out great and now I am happy with what I got!


  6. clayzermk1

    April 12th, 2012 @ 11:20 am

    Thanks, I’m up and running.

  7. Jd Daniel

    May 14th, 2012 @ 4:40 pm

    Install instructions work great on Ubuntu 11.10 as well.

  8. 41 North Studios- Creating a Ruby/Rails development environment in OS X using a Parallels virtual machine

    May 31st, 2012 @ 11:22 am

    [...] followed the excellent directions at sekati.com/etc/install-nodejs-on-debian-squeeze to install Node.js. Basically, we are going to use git to clone the Node.js project from github.com [...]

  9. javascript en console et comme serveur !!! | linuxidable

    June 9th, 2012 @ 5:55 am

    [...] article original http://sekati.com/etc/install-nodejs-on-debian-squeeze [...]

  10. Jamie

    June 21st, 2012 @ 1:53 am

    Great how-to, thanks! I’m running the make test now. Fingers crossed :-)

  11. 於 Debian Linux (wheezy) 安裝 Node.js | Tsung's Blog

    October 2nd, 2012 @ 1:16 pm

    [...] Install Node.js on Debian Squeeze [...]

  12. Kevin Campbell

    October 16th, 2012 @ 11:20 am

    You missed a sudo after && in
    sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev

    Not a biggie, but might be worth changing so the recipe is fool proof for beginners.

  13. Install Stats.d / Graphite on a debian server in order to monitor a Symfony2 application (1/2) | ELAO | Le blog technique

    November 9th, 2012 @ 10:57 am

    [...] If you want the full detail, check out the source. [...]

  14. Mathman87

    December 22nd, 2012 @ 2:10 pm

    If you’re having trouble compiling on arm, a site to checkout is http://www.yoovant.com/how-install-node-js-0-8-arm-based-sbc-fox-board-g20/. It helped me a lot.

  15. bennidi

    February 14th, 2013 @ 6:58 am

    Nice work. Got it running without any problems. Thanks man.

  16. Mark

    March 4th, 2013 @ 9:13 pm

    In case someone finds this useful, I’ve created a small project to help you build your own node.js Debian packages:

  17. bstephens

    March 28th, 2013 @ 11:12 am

    Wow! Worked perfectly. Thanks for posting this!

  18. Rebnev

    April 5th, 2013 @ 5:22 pm

    Hello! I’m trying to install nodejs.
    And after make I take this errors.
    I’m newbie in linux, but I guess error in openssl..how to fix it? thx!

    make[1]: execvp: printf: Argument list too long
    make[1]: *** [/root/node/out/Release/obj.target/deps/openssl/libopenssl.a] Error 127
    make[1]: Leaving directory `/root/node/out’
    make: *** [node] Error 2

  19. jason

    May 6th, 2013 @ 1:37 pm

    Sounds like you need to install openssl: sudo apt-get update && sudo apt-get install openssl

  20. lonyi

    May 6th, 2013 @ 11:06 pm

    yes,I love you !

  21. Julian Romera Juarez

    May 26th, 2013 @ 11:35 pm

    Wow, great, thanks! worked like a charm!

  22. juan

    May 31st, 2013 @ 12:13 am

    hi … i have a problem when a try to install node.js
    i look this
    git clone https://github.com/joyent/node.git
    username node :
    and i dont know

    sorry for my english

  23. Krisu

    July 12th, 2013 @ 11:12 am

    Debian Squeeze. Node installed. Works fine. Thanks bye.

  24. Andrii

    July 18th, 2013 @ 1:37 am

    I get this error when doing “make”:

    make[1]: execvp: printf: Argument list too long
    make[1]: *** [/root/nodetest/node/out/Release/obj.target/deps/openssl/libopenssl.a] Error 127
    make[1]: Leaving directory `/root/nodetest/node/out’
    make: *** [node] Error 2

    Don’t know what’s happening here.

  25. Andrii

    July 18th, 2013 @ 1:52 am

    But it still installed with “sudo make install” and both node and npm seem to work fine. I wonder if I’ll find any problems with it later.

  26. Souley

    July 27th, 2013 @ 6:28 am

    Thanks so much works like a charm!

  27. William

    September 19th, 2013 @ 9:38 am

    The best explanation about this! thanks a lot

  28. Aaron

    October 7th, 2013 @ 2:33 pm

    Hey, It bloody worked on Deb7—Wheeeezy!

  29. can't install libxml using nodejs on debian squeeze | Technology & Programming

    November 17th, 2013 @ 9:08 am

    [...] I’m running debian squeeze I did aptitude install libxml2-dev And I followed this howto to install node.js on my server https://sekati.com/etc/install-nodejs-on-debian-squeeze [...]

  30. Installing Web Development Environment on Debian 7.2.0 | blog.chrisrussell.net

    November 21st, 2013 @ 6:13 pm

    [...] I’m following the instructions here: http://sekati.com/etc/install-nodejs-on-debian-squeeze [...]

  31. Installing node.js on debian 7 64 Bit | Webhaggler

    November 28th, 2013 @ 2:47 pm

    [...] http://sekati.com/etc/install-nodejs-on-debian-squeeze [...]

  32. Description and modeling of FlapMMO score data | ahstat webpage

    March 11th, 2014 @ 3:58 am

    […] How to install node.js on Debian. […]

  33. Tsumiki

    March 19th, 2014 @ 4:52 am

    Thank’s a lot! all work perfectly. Nice work

  34. lamoon

    May 14th, 2014 @ 11:57 pm

    Thank you, it’s work for me on debian 6

  35. Esolitos

    June 10th, 2014 @ 5:23 pm

    Thanks, i used the branch v0.11.0-release and it worked without any issue.

  36. Install Node.js on Debian | Monica Lent

    June 13th, 2014 @ 5:38 am

    […] node modules so much as it was with my node install itself. I had installed from source following this guide, but it wasn’t quit enough to get my node install right on Debian […]

  37. debian-install-node-npm

    October 11th, 2014 @ 9:17 am

    I must install python for it runs…
    $ sudo aptitude install python

  38. Thomas Daly

    October 15th, 2014 @ 9:35 am

    Please could you explain what you mean by ‘isolate node’? Thank you!

  39. Aniket Lawande

    November 21st, 2014 @ 12:24 am

    Thanks man !!
    I had some nodejs transform scripts I needed to run on Deb 6 virtual machines. Worked like a charm !!!

  40. AOlszak

    January 31st, 2015 @ 8:15 pm

    Thx man!

  41. Stewart Dinnage

    February 10th, 2015 @ 4:46 am

    I’m having an issue at the make step.
    project not configured (run ‘waf configure’ first)
    any ideas? will be appreciated greatly.

  42. Ingmar

    March 4th, 2015 @ 6:31 am


  43. ololoshka

    January 22nd, 2016 @ 4:33 am