×

How to install Node Debian 12? – LinuxWays

How to install Node Debian 12? – LinuxWays


Node.js is a freely available, cross-compatible JavaScript runtime environment that runs JavaScript coding independently of a web browser. This makes it a crucial resource in developing server-side and networking applications. Debian, on the other hand, is a free operating system (OS) for your computer that uses the Linux kernel.

The process of installing Node.js on Debian 12 is straightforward and requires only a basic understanding of command-line interfaces. By following this step-by-step guide, you will be able to install Node.js on your Debian system, check its version, and will also get to know how to uninstall it from your system.

Let us now proceed to the installation steps.

Updating the System

To begin with, we will first update our system. By updating, you ensure the inclusion of the most recent security patches, system enhancements, and updated versions of the software packages already installed.

Use the command:

sudo apt update && sudo apt upgrade

After you have updated, move forward with the Node.js installation process. For that we first need to install curl.

Installing Curl

Curl is a tool utilized for sending or receiving data to/from a server. This command-line tool supports several protocols, including HTTP, HTTPS, and FTP. It’s instrumental for the next step, where we add the NodeSource PPA to our system. Initiate the installation of curl with:

Adding NodeSource PPA to Your System

With curl installed, the next step is to add the NodeSource PPA to your system. We will be using the NodeSource PPA, which houses the Node.js distributions. Execute the given command for this:

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash

Updating the System’s Package Lists Again

After adding the NodeSource PPA, it’s necessary to refresh the package lists of your system once more. Do this by:

Installing Node.js

We are prepared to install Node.js, which also includes npm in the installation command. Npm acts as the package manager for Node.js and it’s utilized for installing Node packages. Continue with the installation of Node.js and npm by executing:

sudo apt install nodejs npm

Verifying the Installation

After the installation process is completed, ensure that both Node.js and npm have been correctly installed. This can be done by:

Each command will return the installed version of Node.js and npm, respectively. If they return a version number, you have successfully installed Node.js and npm on your Debian 12 system.

Uninstalling node

While Node.js is a powerful tool in your programming toolkit, there may be situations where you need to uninstall it from your system. For that, simply run the command:

sudo apt remove nodejs npm

The system will ask your approval before proceeding with the uninstallation process. Do confirm and it will be uninstalled from your system.

Conclusion

By adhering to the steps outlined above, you have updated your system, installed curl, added the NodeSource PPA, and finally installed Node.js along with npm. The successful return of version numbers is confirmation that Node.js and npm are now ready for use on your system.

With Node.js and npm installed, you are now equipped with a powerful toolset that can enable you to build server-side and networking applications.

 



Source link