ng: command not found Angular Origin: On your device Last updated 15 Oct 2026

Angular CLI: zsh: command not found: ng / 'ng' is not recognized as an internal or external command

The Angular CLI is not installed globally or its folder is not on your PATH.

Exact message you may see ng: command not foundzsh: command not found: ng'ng' is not recognized as an internal or external commandbash: ng: command not foundng is not recognized as the name of a cmdlet
Seen on: Angular Angular CLI Linux Windows

Meaning

Install it with npm install -g @angular/cli, or avoid global installs and use npx ng … / the project's node_modules/.bin. If it was installed but the command is missing, the npm global bin folder is not in PATH (common with nvm or after changing Node versions).

Common causes

  • @angular/cli not installed globally
  • npm global bin directory not in PATH
  • Switched Node version with nvm (global packages are per version)
  • Corporate machine without admin rights installing to a protected folder
  • Typo (ng-serve)

⚡ Quick fix

  1. Install: npm install -g @angular/cli
  2. Or run through npx: npx ng serve
  3. Add the npm global bin folder to PATH

Detailed fix by platform

Linux

  1. npm config get prefix then add <prefix>/bin to PATH; with nvm reinstall the CLI under the active version
  2. npx @angular/cli@latest new my-app creates a project without a global install

Windows

  1. Check npm config get prefix and add that folder to the user PATH; restart the terminal

Code examples

Use the project-local CLI

bash
npx ng version            # uses node_modules/.bin/ng if present
npm i -D @angular/cli     # local install, then: npm run ng -- serve

How to diagnose

  1. Install — Is @angular/cli installed? (npm ls -g)
  2. PATH — Is the npm bin folder in PATH?
  3. Node — Same Node version as when installed?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

command not found — bash: command not found (Linux)command not foundCould not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…ENOENT — npm ERR! enoent ENOENT: no such file or directory, open '/path/package.json' (npm)ENOENTexceeded maximum budget — Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB (Angular)exceeded maximum budg…Node.js version detected. The Angular CLI requires a minimum — Angular CLI: Node.js version v16.20.2 detected. The Angular CLI requires a minimum Node.js version of v18.19.1 (Angular)Node.js version detec…Port 4200 is already in use — Angular CLI: Port 4200 is already in use. Use '--port' to specify a different port (Angular)Port 4200 is already …Repository is not clean — Angular CLI: Repository is not clean. Please commit or stash any changes before updating. (Angular)Repository is not cle…Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…ng: comma…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.