
Method 2: Install Node.js and npm from NodeSource You should get the following output: 7.5.2 You can also check the npm version using the following command: $ npm -v You should get the following output: v12.22.5 Once both packages are installed, verify the Node.js version using the following command: $ node -v

Install the Node.js and npm with the following command: $ apt install nodejs npm At the time of writing this tutorial, Node.js version 12.22.5 is included by default on Debian 11 repositories. However, it does not contain the latest Node.js version. The simple and easiest way to install Node.js and npm is to install them from the Debian default repository. $ apt upgrade Method 1: Install Node.js and npm from Debian Repository You can do this by running the following commands: $ apt update Additionally, replace ‘root’ with the username of the admin account if necessary.īefore starting, you have to make sure that all Debian OS packages installed on the server are up to date. You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Log in to the Server & Update the Server OS Packagesįirst, log in to your Debian 11 server via SSH as the root user: $ ssh -p Port_number

Method 2: Install Node.js and npm from NodeSource.Method 1: Install Node.js and npm from Debian Repository.Log in to the Server & Update the Server OS Packages.
