How can I install Node Js & npm in Xfce/Debian based linux distros. Please help me.
-
Give nvm a go, I use it to install node.js on anything... (I run node on windows, debian and RaspberryPi OS (debian based) Install multiple versions and switch with a single command https://github.com/nvm-sh/nvm/blob/master/README.md – JoeCrash Apr 08 '22 at 18:15
-
^^^ The answers that were last revised after 2020 are more up to date. – karel Apr 09 '22 at 06:29
1 Answers
I got it. Here is the solution : Step 1: Download latest or recommended node .tar.xz file from https://nodejs.org/en/
or you can download node version 14.15.5 (.tar.xz file) directly from here ->
https://nodejs.org/dist/v14.15.5/node-v14.15.5-linux-x64.tar.xz
Step 2: Go to the directory in which (.tar.xz file) is downloaded.
In my case --> /Download directory
Step 3: Update System Repositories
sudo apt update
Step 4: Install the package xz-utils
sudo apt install xz-utils
Step 5: To Extract the .tar.xz file
sudo tar -xvf name_of_file
In my case --> sudo tar -xvf node-v14.15.5-linux-x64.tar.xz
Step 6: sudo cp -r directory_name/{bin,include,lib,share} /usr/
In my case --> sudo cp -r node-v14.15.5-linux-x64/{bin,include,lib,share} /usr/
Step 7: Check the node version
node --version
Result In my case -> v14.15.5