
the one recommended for production environments, and the 16.x branch is the most recent one. At the time of writing this post, the 14.x branch is the LTS branch, i.e. Getting recent versions of NodeJS on Debian 11īy adding an external repository, it is possible to install a recent version of NodeJS. This is the fastest and safest way to install NodeJS, but it is not the only one, nor is it necessarily the best. When finished, you can check the installed version with the command: node -version Although there are a lot of them, the reality is that the installation will be very fast.

This way, you will be shown many of the dependencies to install. Now, you can install NodeJS as follows sudo apt install nodejs So, open a terminal emulator or connect via SSH to Debian 11 and update it first: sudo apt update In this case, it is also available from the official Debian 11 repositories so the installation becomes easier. It is advised to install build-essential as well as you might need to build native addons, depending on what NPM packages you will need.Taskset Cheatsheet | Pandoc Cheatsheet | Curl Cheatsheet | Grep CheatSheet | Cron CheatSheet | Grep CheatSheet | More!Īs NodeJS is widely supported on Linux, it is common to find it in the official repositories of almost any distribution. Last step is to install the nodejs package: sudo apt-get install -y nodejs Sudo apt-get update & sudo apt-get install yarn # To install the Yarn package manager, run:Įcho "deb stable main" | sudo tee /etc/apt//yarn.list # You may also need development tools to build native addons: When finished, the update should look like this: # Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm This will populate the apt-get cache, add the NodeSource signing key to your keyring, and add the apt sources list. To install a different version, replace 10.x with your preferred version string: cd ~

Add the NodeSource PPAįrom your home directory, use curl to retrieve the installation script for your preferred Node.js version. I have used as a starting point the DigitalOcean tutorial but they have some steps that I don't find useful and so I am only including the essential steps to quickly get started with Node.js and NPM on Ubuntu 18.04. However I believe the version that comes with apt-get by default is quite old, so I needed to install using another PPA (personal package archive). Having just created a new Ubuntu 18.04 VM in Azure, I wanted to start using Node.js and NPM directly.
