node: command not found
The node: command not found error means Node.js is missing from your PATH. Fix it by installing Node.js via nvm, a package manager, or the official installer.
What It Means
The operating system searched every directory listed in the PATH environment variable for a binary called node and didn’t find one. Node.js is a prerequisite for virtually all modern frontend tooling (Webpack, Vite, Next.js) and backend JavaScript development.
Why It Happens
- Node.js has never been installed on the system.
- Node.js was installed via a version manager like
nvmbut no version is currently active. - The Node.js installation directory was removed or the PATH was modified.
- Node.js was installed for a different user account.
- A package manager installation was corrupted or incomplete.
How to Fix It
1. Install Node.js with nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bashClose and reopen your terminal, then install the latest LTS version:
nvm install --lts
nvm use --lts
node --version # v22.14.02. Install via package manager
Ubuntu / Debian:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejsmacOS (Homebrew):
brew install nodeWindows: Download the LTS installer from nodejs.org and run it.
3. Activate an existing nvm installation
If nvm is installed but inactive:
source ~/.bashrc
nvm use --ltsTo set a default version automatically:
nvm alias default 'lts/*'4. Check PATH manually
Verify where node should be:
which node # or "where node" on Windows
echo $PATH # confirm the Node.js bin directory is listedIf Node.js is installed but not in PATH, add it:
export PATH="/usr/local/bin:$PATH" # Linux/macOSAdd that line to your ~/.bashrc or ~/.zshrc to make it permanent.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro