Installing Node.js
You download Node.js once, and it installs both the node command and npm.
In this page:
Installing Node.js
Download the LTS installer from nodejs.org, or use a version manager such as nvm so you can switch versions per project. Package managers like apt, brew and winget also work. After installing, verify with node --version and npm --version.
Note:
Use the LTS (long-term support) release for production projects.
Example: Installing Node.js
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ nvm install --lts
$ node --version
v20.11.1
$ npm --version
10.2.4
⚠️ Run this in your own terminal or Node.js environment.
Related Topics
Common Mistakes
- Installing an odd-numbered non-LTS release for production
- Installing with sudo npm and creating permission problems
- Not restarting the terminal so PATH is not updated
Chapter Summary
- Install the LTS release
- nvm manages multiple versions
- node --version verifies the install
- npm comes bundled
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: