DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 963,864 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Aashish Panthi
Aashish Panthi

Posted on • Originally published at aashishpanthi.hashnode.dev

Step by step instructions to install node and npm using Linux binaries

Yes, you can install node through apt package manager with the command sudo apt install nodejs and you get the latest nodejs installed. But many people find it very complicated to install Binaries. So, I will be breaking down the process into four simple steps. (Note: I'm using pop os and will be installing node v14.17.3).

Let's start:

1. Get the binary file

So head to nodejs website and download binary files of latest stable nodejs.

Nodejs download website

2. Extract the tar file

Go to the directory where you've downloaded your nodejs. In my case its Downloads directory.

Downloads directory

Then, extract the files with this command tar -xf "*your_downloaded_file*"

Tar extract

Or, go to Downloads folder using file manager, right click on tar file and extract (so simple).

Extract through file manager

3. Copy folders to /usr

Now we get these all folders inside our extracted node folder.

Files and folder

Here we need to cd inside that folder. Type the command sudo cp -r ./{lib,share,include,bin} /usr hit enter and type your password. Remember to use -r flag to make sure that all files inside those folders are also copied.

Copy to /usr

4. Check the node and npm version

You can check nodejs version with the command node --version or node -v and check npm version withnpm --version.

Node and npm version check

That's it, you have now installed nodejs and npm in your system. Enjoy 😎

Top comments (2)

Collapse
 
lemenio profile image
Lemenio

Thanks for the complete instruction, it works well, thanks.

Collapse
 
s4wet profile image
s4wet

it work thank

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

⭐️🎀 JavaScript Visualized: Promises & Async/Await

async await