Setup Node Environment

It is highly recommended (will be required very soon) to use Node version 18 or above. You can check your version by executing node --version in your terminal. If you find out that you are using a version less than 18, then this guide is for you.

Preparation

  • Your terminal. Please get yourself used to access your terminal. This will be the most common tool to use during the development.
  • NVM. Check https://github.com/nvm-sh/nvm for installation guide or below for macOS homebrew guide.

Install NVM in macOS

For simplicity, homebrew is recommended when installing NVM or any other CLI tools in macOS. Once you have homebrew ready on your machine, you can simply use the following one-line command to install NVM. Very simple and easy.

brew install nvm

Use NVM

For instance, to install Node version 18 (latest minor version with major version 18), you can do something like:

nvm install 18

To use node version 19 after installation (or when you are starting a new terminal window and your default version is less than 18), run the following command with your version (19 in this case):

nvm use 18

Very simple and easy!

To set the default version of Node that will be used when you start the terminal, you can use the following command:

nvm alias default 18

You can always check NVM documentation for more information.

September 5, 2023