Overview
Node.js is an open-source, cross-platform JavaScript runtime environment built on the Google V8 engine. It executes JavaScript outside the web browser, allowing developers to build command-line utilities, APIs, web servers, and modern frontend application toolchains.
When installing Node.js, you also receive npm (Node Package Manager), the default package registry client used to manage dependencies and executable scripts.
Step 1: Choosing Between LTS and Current
The Node.js release schedule offers two distinct release channels:
- LTS (Long Term Support) Recommended: Designated with even major numbers (e.g., v20, v22). LTS releases receive 30 months of active maintenance and critical security patches. Always use LTS for production, enterprise, and standard development environments.
- Current: Contains active development features, modern ECMAScript proposals, and experimental APIs. Recommended only if testing cutting-edge runtime features.
Step 2: Installation on Windows
Method A: Official MSI Installer (Simplest)
- Download the Windows Installer (
.msi) 64-bit LTS package from nodejs.org. - Run the installer and accept the license terms.
- Keep the default destination path:
C:\Program Files\nodejs\. - In the Custom Setup screen, ensure all components are checked:
- Node.js runtime
- corepack (package manager manager)
- npm package manager
- Add to PATH (ensures
nodeandnpmare available in your command terminal)
- In the Tools for Native Modules step, you may leave the Chocolatey / Visual Studio build tools unchecked unless you intend to compile C++ native addons (
node-gyp). - Complete the setup wizard.
Method B: Using Windows Package Manager (winget)
Open Windows Terminal or PowerShell and run:
winget install OpenJS.NodeJS.LTS
Step 3: Verification of Environment Paths
Restart your terminal window to ensure the updated system PATH environment variable is reloaded. Run the following verification commands:
node -v
npm -v
Expected output:
v22.12.0
10.9.0
To verify where the binary is installed:
# In PowerShell:
Get-Command node
# In Command Prompt:
where node
Step 4: Configuring Global NPM Directories
By default on Windows, npm installs global packages into %APPDATA%\npm. Verify that this directory exists and is present in your user PATH:
npm config get prefix
If you need to update npm to the latest version independently of the Node.js installer:
npm install -g npm@latest
Troubleshooting Common Errors
'node' is not recognized as an internal or external command
- Cause: The Node.js binary directory was not appended to the system
PATHenvironment variable. - Fix: Open System Properties > Environment Variables. Under System Variables, locate
Path, click Edit, and addC:\Program Files\nodejs\. Restart your terminal.
EACCES: permission denied when installing global packages
- Cause: Permissions error writing to system-protected directories.
- Fix: On Windows, run your terminal as Administrator, or configure a custom npm global directory inside your user profile folder using
npm config set prefix "%USERPROFILE%\.npm-global".