Setting up a clean, professional Node.js development environment is the foundation of every backend developer's journey. In this tutorial, you will install Node.js Long Term Support (LTS) using Node Version Manager (NVM), verify your NPM installation, and configure Visual Studio Code with the best developer extensions.
Directly downloading an installer from nodejs.org often causes permission errors when installing global tools and makes it difficult to test projects requiring different Node versions. NVM solves this cleanly.
github.com/coreybutler/nvm-windows/releases.nvm-setup.exe and follow the standard installation wizard.nvm install lts
nvm use lts
# Download and install nvm via curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# Reload your shell profile (.bashrc or .zshrc)
source ~/.bashrc
# Install and activate the latest active LTS version
nvm install --lts
nvm use --lts
Run the following verification commands in your terminal:
node --version
# Output: v22.11.0 (or current LTS)
npm --version
# Output: 10.9.0 (or current version)
npx --version
# Output: 10.9.0
When using NVM, global NPM packages are installed inside the specific active Node version directory, eliminating the dreaded EACCES: permission denied errors common on Linux and macOS.
Visual Studio Code is the gold-standard editor for JavaScript and Node development. Install the following essential extensions from the VS Code Marketplace:
.http files without needing third-party Postman software..env environment variable files.To debug Node.js code with breakpoints instead of relying solely on console.log, create a .vscode/launch.json file in your project root:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/index.js",
"restart": true,
"console": "integratedTerminal"
}
]
}
Boost your server-side JavaScript proficiency by studying these closely connected core modules:
Run your first script and inspect console outputs.
Interactive command-line execution and inspector flags.
Initialize packages, manage dependencies, and write scripts.