Skip to content
04Install guides · 10 min

Install Node.js (LTS)

Node.js runs JavaScript outside the browser. Many AI tools (Codex via npm, Gemini CLI, web projects) need it.

Roman Urdu: Node.js bohat se AI tools aur websites ke liye zaroori ha. Hamesha LTS version lein, woh stable hota ha.

Cost: Free, open source.

Windows

  1. Easiest: on nodejs.org/en/download pick the LTS version (v26 on 2026-12-05) and download the Windows Installer (.msi). The page says to use the .msi for system-wide installs when possible. Click Next through the defaults.
  2. Or use fnm, a version manager the Node.js page recommends for Windows, in PowerShell:
    $ winget install Schniz.fnm
    $ fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression
    $ fnm install --use 26
  3. Close and reopen the terminal before you check.

macOS

  1. Easiest: download the macOS Installer (.pkg) for the LTS version from nodejs.org/en/download and open it.
  2. Or use nvm, the default the Node.js page shows for macOS:
    $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
    $ \. "$HOME/.nvm/nvm.sh"
    $ nvm install 26

Linux (Ubuntu/Debian)

  1. Use nvm, the default the Node.js page shows for Linux. No sudo needed (works on Fedora and WSL too):
    $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
    $ \. "$HOME/.nvm/nvm.sh"
    $ nvm install 26
  2. Skip sudo apt install nodejs: Ubuntu's own package is often several versions behind.

Android (Termux)

  1. Termux packages its own LTS build. It can lag behind nodejs.org (v24 there on 2026-12-05):
    $ pkg update
    $ pkg install nodejs-lts

Check it worked

$ node -v
$ npm -v

v26.x.x (the LTS on 2026-12-05 was v26.14.0), then an npm version number

Common errors

node is not recognized / command not found right after installing
Close every terminal window and open a new one.
nvm: command not found
Run \. "$HOME/.nvm/nvm.sh" or open a new terminal. The nvm installer adds itself to your shell profile for new windows.
npm install -g fails with EACCES (permission denied)
Do not use sudo. Install Node with nvm or fnm, which keep global packages in your home folder.
PowerShell: "npm.ps1 cannot be loaded because running scripts is disabled on this system"
Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser once, then reopen PowerShell. Or use npm.cmd instead of npm.
fnm: node disappears in a new PowerShell window
Add the line fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression to your PowerShell profile (notepad $PROFILE), or use the .msi installer instead.

Official docs

Checked against these pages on 2026-12-05. Tools change: if a step differs, the official page wins.