Installing Node.js
Node.js can be installed directly from nodejs.org, via a system package manager, or — the most flexible option — through a version manager that lets you switch between Node versions per project.
Using a Version Manager (nvm)
# Install nvm, then:
nvm install --lts
nvm use --lts
node --version
npm --versionLTS vs Current
| Release Line | Best For |
|---|---|
| LTS (Long-Term Support) | Production applications — stable, supported for years |
| Current | Trying out the newest features, not recommended for production |
Running Scripts
node script.js
# Start an interactive REPL
nodenpm Ships With Node.js
Installing Node.js automatically installs npm (Node Package Manager) alongside it — you don't need to install it separately, and its version is tied to the Node.js version you installed.
Best Practice
Use a version manager like nvm from the start, even on your very first project — different projects (and teammates) often require different Node versions, and switching should be a one-line command.