Skip to content
node: command not found

node: command not found

DodaTech 2 min read

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 nvm but 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 | bash

Close and reopen your terminal, then install the latest LTS version:

nvm install --lts
nvm use --lts
node --version   # v22.14.0

2. Install via package manager

Ubuntu / Debian:

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs

macOS (Homebrew):

brew install node

Windows: 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 --lts

To 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 listed

If Node.js is installed but not in PATH, add it:

export PATH="/usr/local/bin:$PATH"   # Linux/macOS

Add that line to your ~/.bashrc or ~/.zshrc to make it permanent.

Can I run JavaScript without Node.js?
You can run JavaScript in a web browser’s console, but for server-side code, build tools, or command-line scripts you need Node.js. Nearly all modern JavaScript development depends on it.
What's the difference between node and nodejs?
On some Linux distributions (Debian/Ubuntu), the Node.js package installs the binary as nodejs to avoid conflict with the node ham radio package. You may need sudo apt install nodejs and then create a symlink with sudo ln -s /usr/bin/nodejs /usr/bin/node.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro