Dev Setup

Fix “node is not recognized” and npm install problems on Windows, macOS, and Linux

Step-by-step troubleshooting when Node.js or npm is missing, PATH is wrong, or npm install fails after you set up VS Code with Dev Setup.

Dev Setup configures Visual Studio Code extensions so you can write JavaScript and TypeScript comfortably. It does not install Node.js itself. If the terminal says “node is not recognized,” “npm: command not found,” or npm install dies with network or permission errors, the editor is fine—the runtime on your machine is not ready yet. This guide walks through verifying installs, fixing PATH, choosing an LTS version, and recovering from common npm failures without reinstalling VS Code.

What Node and npm are (in one minute)

Node.js is the JavaScript runtime used for local tools, servers, and many frontend build pipelines (Vite, Next.js, Create React App). npm ships with Node and downloads packages listed in package.json. VS Code can edit your files without Node; running scripts, starting a dev server, or installing dependencies requires Node on the PATH of the same terminal where you type commands.

Confirm whether Node is installed

  1. Open a new terminal inside VS Code (Terminal → New Terminal).
  2. Run: node -v
  3. Run: npm -v
  4. If both print version numbers (for example v22.x and 10.x), Node is installed for that shell. Skip to the npm install section.
  5. If either command fails, install Node (next section) and open a brand-new terminal tab afterward—old shells keep a stale PATH.

Install an LTS build (recommended)

Prefer the current Long Term Support (LTS) release from the official Node.js site unless a course or job requires a specific major version. On Windows, the MSI installer can add Node to PATH for you—leave that option checked. On macOS, the pkg installer or a version manager (nvm, fnm) both work; beginners often start with the pkg. On Linux, use your distro’s documented method or NodeSource / fnm—avoid copying random curl scripts you do not understand.

  • Windows: after install, close every terminal and open a new one before testing node -v again.
  • macOS: if you use zsh, restart Terminal.app or open a new VS Code terminal tab.
  • Corporate PCs: policy may block installers—ask IT for an approved Node package.

PATH problems after install

Symptoms: Node works in PowerShell outside VS Code but not inside it, or works in Command Prompt but not in Git Bash. Cause: different shells load different PATH profiles. Fix: fully quit VS Code (all windows), reopen, then New Terminal. On Windows, confirm the Node install directory appears under System or User environment variables. On macOS/Linux, ensure your shell init file exports the path your installer used (for nvm, the init snippet must run for non-login shells VS Code often starts).

When npm install fails

  • Network / proxy: company networks may block the registry. Try another network or configure npm proxy settings your employer documents.
  • Permission errors on global installs: prefer local project installs (npm install without -g) unless you know you need a global CLI.
  • Corrupted cache: npm cache clean --force, delete node_modules and package-lock.json, then npm install again (only if you understand the project can regenerate the lockfile).
  • Wrong folder: run npm install in the directory that contains package.json, not the parent repo root by mistake.
  • Node too old or too new for the project: check the engines field in package.json and match a supported major version.

How this relates to Dev Setup

After Node works, the Node / TypeScript or full-stack presets in Dev Setup make more sense: ESLint, Prettier, and related extensions assume you can run npm scripts. If you only needed HTML/CSS preview, you can stay on the frontend preset and install Node later. For feedback on this documentation, use GitHub Issues: https://github.com/smartopslab128-ctrl/gif-image-paste/issues