Orbitalunderground HD Productions > Orbitalunderground [HD] Productions - Help Desk > Knowledgebase

Search help:

Node.JS (Proper) INSTALL on Debian 7-wheezy(x64)


Step 0: TL;DR - Install Node.js Quickly on Debian

Before we get started, if you just want to get Node.js installed on Debian (specifically Wheezy, Jessie, Stretch, or Sid) fast, here are the two commands you need to run.


# Adding the NodeSource APT repository for Debian-based distributions repository AND the PGP key for verifying packages

$ sudo curl -sL | bash -


# Install Node.js from the Debian-based distributions repository

$ sudo apt-get install -y nodejs

Step 1: Environment Setup - Ensure Your Environment Meets the Basic Requirements to Install Node.js

To be able to install Node.js in a Debian environment, the machine you're installing Node.js on meets the following requirements:


Your environment is on a supported architecture:

i386 (32-bit)

amd64 (64-bit)

armhf (ARM 32-bit hard-float, ARMv7 and up: arm-linux-gnueabihf)

Your environment is using a supported Debian distribution:

Debian 7 (Wheezy)

Debian 8 / Stable (Jessie)

Debian Testing (Stretch - aliased to Jessie)

Debian Unstable (Sid)


Note: Debian 7 Wheezy on armhf architectures is not supported.


Step 2: Basic Setup: Setting Up the Correct APT Repository to Install Node.js

Let's start working on getting the correct Node.js binary. To do so, you need to add the maintained APT repository for Debian-based Node.js, and add the APT repository's associated PGP key to the system's APT keychain.


This step is necessary, as the repository that apt-get install nodejs defaults to is severely outdated - it defaults to a Node.js 4 release line that is missing several large security updates.


To set up the reccomended APT repository for Node.js that is consistently maintained and updated and update the APT keychain with the APT repository's PGP key most quickly, you can run the following command:


# Download and setup the APT repository add the PGP key to the system’s APT keychain,

$ sudo curl -sL | bash -

This script completes both steps of adding the apt-get repository to the system and adds the repository's PGP key to the APT keychain. The Node.js Debian-based distributions are hosted, maintained, and signed by NodeSource, and this script - including the currently run scripts, their commit history, and the scripts for previous versions of the Node.js Debian installer are all publicly available on GitHub. If you want to take a deep dive into understanding how it’s accomplished, go check them out!


Step 3: Running apt-get to Install Node.js

After the APT repository from Step 2 is set up, we can install Node.js with the standard apt-get command. Here's the exact command needed:


$ sudo apt-get install -y nodejs

After the command runs successfully, Node.js should now be properly installed on the Debian system!


Step 4: Confirm that Node.js was Installed Correctly

To make sure that Node.js was installed correctly on your machine, you can run a quick test by using the following command:


$ node -v

If Node.js was correctly installed, you should see something resembling (but probably not exactly matching) this:


$ node -v // The command we’re running


Step 5: Update Your npm Version

One final step for good measure is to update the version of npm. There's always a specific version of npm that ships with Node.js. That said, the release cycle of npm is not in sync with the release cycle of Node.js - as such, there's frequently a newer version of npm than the one that comes with Node.


To update your version of npm, simply run the following command:


$ sudo npm install npm --global


Step 6: Start using Node!

Article details
Article ID: 24
Category: Knowledgebase

« Go back