Ben Force
Ben Force - 5x AWS Certified Senior Software Engineer.
Published 1 min read

Install Nodejs on Ubuntu

Install Nodejs on Ubuntu

Do you need to install a specific version of node on linux? That’s usually one of my first steps. Along with installing chrome and visual studio code.

Installing Node Version Manager

The easiest way I’ve found to get node installed is with Node Version Manager (nvm). This utility allows you to quickly install, and switch between, versions of node. To get started, use curl to pipe the script into bash.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Installing Node LTS

If you know which version of node you need you can install it directly.

nvm install 14.15.2

Or, if you just want the LTS distribution of a version.

nvm install 14 --lts

You’ll see the version you requested download and install.

install-node-14.gif

Changing Versions

If you ever end up working on multiple projects that each require a different version of node, you can switch versions quickly by using the use command. It allows you to switch to any installed version.

nvm-select-version.gif

Closing

I hope this tutorial helped you get node installed quickly. If it did you should go give nvm some stars, it’s a great time saver!


References

https://github.com/nvm-sh/nvm


Related Posts