Install nvm for Running Different Node.js Version Locally

2022/07/091 min read
bookmark this
Responsive image

Table of Contents

  1. Introduction
  2. Download the Script to Install nvm
  3. Run the Script
  4. Restart Terminal
  5. Verify nvm
  6. Install Node.js 14
  7. Conclusion

Introduction

This guide shows how to install nvm (Node Version Manager) so you can run different Node.js versions on your local machine. nvm is useful when you need to switch between Node.js versions for different projects.

Download the Script to Install nvm

curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh -o install_nvm.sh

Run the Script

bash install_nvm.sh

Restart Terminal

After running the install script, close and reopen your terminal for the changes to take effect.

Verify nvm

nvm list

Install Node.js 14

nvm install v14

Conclusion

With nvm installed, you can easily switch between different Node.js versions by running nvm install and nvm use commands. This is especially useful when working on multiple projects that require different Node.js versions.