Skip to content

Instantly share code, notes, and snippets.

@josfam
Last active December 22, 2025 14:21
Show Gist options
  • Select an option

  • Save josfam/a6db35d739a8fee3cca75176155e715e to your computer and use it in GitHub Desktop.

Select an option

Save josfam/a6db35d739a8fee3cca75176155e715e to your computer and use it in GitHub Desktop.
How to install nodejs with nvm on Ubuntu (and other Debian-based distros).

How to install nodejs with nvm on Ubuntu (and other Debian-based distros).

update the package list

sudo apt update

Download with curl and run the nvm installation script

  • Install curl if you don't have it already
sudo apt install -y curl
  • Download the nvm script file with curl and run it
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Verify nvm installation

command -v nvm
  • If the output is nvm, then nvm is installed correctly.

Install Node.js with nvm

  • To install the latest LTS version of Node.js
nvm install --lts

Verify Node.js installation

node --version
  • This should output the version of Node.js that was installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment