Check What’s Already on Your System
Before you install anything, confirm whether Node.js and npm are already available. Open your terminal — the built-in Terminal app on macOS, the integrated terminal in VS Code, or any other shell — and run the following command:
node -v
If Node is installed, the terminal prints its current version number:
v16.9.1
The exact numbers don’t matter. Seeing any version at all confirms npm is present. If neither Node nor npm exists, you’ll see a “command not found” error instead. In the rare case where one is installed but the other isn’t, it’s worth uninstalling the remaining one before continuing so you start from a clean slate.
Install Node Version Manager
The officially recommended way to install Node and npm is through Node Version Manager, or nvm. It lets you install, update, and remove Node versions, and switch between multiple releases when needed. For now, you only need the latest stable version, but having nvm in place makes future upgrades and version changes much simpler.

Windows
On Windows, the process is more direct. Download and run the latest NVM for Windows installer, which you can also install manually if you prefer. Once installed, open the terminal and run nvm list available to see which Node versions are downloadable. Then use:
nvm use <version>— for example,nvm use 16.9.1— to select a specific Node version.latest,lts, ornewestin place of a version number, wherenewestrefers to the most recently installed version.
After installation, nvm behaves the same way on Windows as on other systems.
macOS
On macOS, fetch nvm with the following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
The version in that command (0.39.0) was the latest at the time of writing; check the nvm installation readme for a newer release if one exists. When you run the command, the terminal will output a lot of text that you can mostly ignore. Just make sure the process completes without an error. If you’re prompted for input mid-installation, press q to quit and continue.
You’ll know the installation finished when the cursor blinks at the prompt again. You may see something like this once nvm is ready:
=> Close and reopen your terminal to start using nvm or run the following to use it now:
Assuming there were no errors, the simplest next step is to quit and restart your terminal app. That gives you a clean shell before continuing.
Install Node and npm Together
With nvm in place, installing Node is a one-line command:
nvm install node
Running it triggers a message like Downloading and installing node v17.1.0 — the version may differ, and that’s fine. nvm pulls whatever the latest stable release is at runtime. Wait until the command finishes and you’re back at the prompt.
That single command installs both Node and npm. Verify everything is in order with node -v and npm -v; if both return version numbers, you’re set. From here, you can move on to installing packages into an actual project.



