

It will give you on-demand access to the newest versions of Node.js, but will also allow you to target previous releases that your app may depend on. Using nvm, you can install multiple, self-contained versions of Node.js which will allow you to control your environment easier. However, in order for some npm packages to work (such as those that require compiling code from source), you will need to install the build-essential package:Īn alternative to installing Node.js through apt is to use a specially designed tool called nvm, which stands for “Node.js version manager”. The nodejs package contains the nodejs binary as well as npm, so you don’t need to install npm separately. After running the setup script from nodesource, you can install the Node.js package in the same way that you did above: The PPA will be added to your configuration and your local package cache will be updated automatically. You can inspect the contents of this script with nano (or your preferred text editor): Make sure you’re in your home directory, and use curl to retrieve the installation script for your preferred version, making sure to replace 6.x with the correct version string: It also lets you choose between Node.js v4.x (the older long-term support version, supported until April of 2017), v6.x (the more recent LTS version, which will be supported until April of 2018), and Node.js v7.x (the current actively developed version).įirst, install the PPA in order to get access to its contents. This will have more up-to-date versions of Node.js than the official Debian repositories. The quickest and easiest way to get the most recent version of Node.js on your server is to add the PPA (personal package archive) maintained by NodeSource. You can set up a user with these privileges in our Initial Server Setup with Debian 8 guide.

A Debian 8 server with a non-root user with sudo privileges.Debian 8 contains a version of Node.js in its default repositories, but this version is outdated, so you’ll explore two methods to install the latest version of Node.js on your system. In this guide, you’ll install Node.js on a Debian 8 server. By leveraging JavaScript on both the front-end and the back-end, development can be more consistent and be designed within the same system. Node.js is a JavaScript platform for general-purpose programming that allows users to build network applications quickly.
