Install NodeJS — without headache.

Ibrahim Zaman
2 min readNov 4, 2023

without making post longer, serious or funny let’s move to our point how to install NodeJS for Linux in _ commands (:

Step 1. Install NVM — Node Version Manager:

Run the following to install NVM on your Linux machine!

# with Curl:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

# or with Wget:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

Install nvim bash completion engine (optional)!

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

Step 2. Installing the stable or latest version or even our favorite node version:

After installing nvm, let’s install any node version of our choice!

# "node" is an alias for the latest version of nodejs:
nvm install node

# to see what are the versions available:
nvm ls-remote

# installing specific version:
nvm install v18.18.2

# to install any LTS version:
nvm install Hydrogen # with codename of LTS version

# to find locally installed version:
nvm ls

# to use specific version:
nvm use node

# to find path to specific node version:
nvm which node

# to find version with respect to codename:
nvm run node --version

Step 3: Let’s upgrade NPM Package Manager to latest version:

npm install -g npm@latest # upgrade to latest version

npm -v # check npm version

Next post will be about anything difficult to install, let me know if you found something difficult.

Ibrahim Zaman aka Mr Tux (@abrahimZaman360)
NodeJS (Image generated by Bing Dall-E)

Quick Tip:

if you’re learning to programming as a beginner? Learn with ChatGPT or Locally if you have Nvidia GPU powered machine using Ollama. You can learn how to deploy LLM models using my guide. See in my profile (:

Thanks for reading…

--

--