Posted by & filed under Node.js.

If you’re like me, you prefer to install Linux packages via the systems package manager. By doing so, whenever you run your update command, you’re going to get the most current copy of everything. Unfortunately, Debian doesn’t seem to have Node.js in their package repo by default:

$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree 
Reading state information... Done
E: Unable to locate package nodejs

Oh no! Thankfully, we can download the package source and compile it that way. Unlike a lot of tarballs I’ve used throughout the years, I’ve yet to have a hitch compiling Node on any of my Debian machines.

Run the following commands to get Node.js installed on your machine. In my example I’m grabbing the latest, v0.8.16, but you’ll want to visit the download page and get the URL of the most current version.

$ sudo apt-get install build-essential
$ wget http://nodejs.org/dist/v0.8.16/node-v0.8.16.tar.gz
$ tar -xzf node-v0.8.16.tar.gz
$ cd node-v0.8.16/
$ ./configure
$ make
$ sudo make install

If everything went as plan, you should have both node and npm installed and ready to go:

$ node -v
v0.8.16
$ npm -v
1.1.69

Thomas Hunter II

Thomas is the author of Advanced Microservices and a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.

Tags:

  • I recently came across a heated email thread about keeping the Debian nodejs packages up-to-date, and it doesn’t look promising in the short term. There are a lot of things about the node.js community & release cycle, and npm & add-ons which don’t fit well into the Debian distribution model and release cycle.

    So I put together a primitive package build system for creating .debs directly from official node.js sources, which maybe someone will find useful until the official Debian maintainers make some progress.

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

    The aforementioned thread is here:
    https://groups.google.com/d/msg/nodejs/W_6avRSG_a8/xeQxLGuHQ5YJ