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

**Code:** `ng: command not found` · **Category:** Angular · **Seen on:** Angular, Angular CLI, Linux, Windows

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/ng-command-not-found)
