You installed the Angular CLI, typed ng version or ng new, and the terminal answered 'ng' is not recognized as an internal or external command, operable program or batch file. In PowerShell the same problem reads The term 'ng' is not recognized as the name of a cmdlet.
The message means your shell cannot find an ng executable in any folder on its PATH. The usual causes are that the Angular CLI was never installed globally, that Node.js is missing, or that the npm global folder is not on PATH (or the terminal was opened before you changed it). The fastest fix is to confirm Node and npm work, run npm install -g @angular/cli, add the folder printed by npm config get prefix to PATH, and open a new terminal. If you only need a one-off command, npx ng works without touching PATH.

The animation is an illustration of how the lookup works, not a real screenshot.
- Why ‘ng’ is not recognized
- Step 1: Check Node, npm and the Angular CLI
- Step 2: Fix it on Windows
- Step 3: Fix it on macOS and Linux
- Use npx ng as a workaround
- Local vs global Angular CLI
- Which Node.js version does your Angular version need?
- Other causes: nvm, permissions and VS Code
- What was tested
- Frequently asked questions
- Summary
Why ‘ng’ is not recognized
- Angular CLI is not installed globally. Installing it inside a project (without
-g) puts it innode_modules/.bin, which is not onPATH. - Node.js or npm is not installed, or its folder is missing from
PATH. - The npm global bin folder is not on PATH. On Windows this is normally the folder printed by
npm config get prefix; on macOS and Linux it is thebinfolder inside that prefix. - The terminal was opened before the install or the PATH change. Already open terminals, including the VS Code integrated terminal, keep the old PATH until restarted.
- nvm or another version switch. Global packages are installed per Node version, so after switching versions the CLI can disappear.
- Permissions. A global install that failed with an access error leaves no
ngbehind.
Step 1: Check Node, npm and the Angular CLI
Run these in a new terminal and note which one fails first:
node -v
npm -v
ng version
npm config get prefix
npm list -g @angular/cli
- If
node -vornpm -vfails, install Node.js from the official Node.js download page (see the version table below), then open a new terminal. - If both work but
ng versionfails, the CLI is missing or its folder is not onPATH; continue with the steps for your system.
The package name is @angular/cli. The old name angular-cli is obsolete, so do not install it.
Step 2: Fix it on Windows
Install the CLI globally, then check where npm puts global commands:
npm install -g @angular/cli
npm config get prefix
With a standard Node.js installer the prefix is usually %AppData%\npm. Windows installs ng.cmd in that folder, so that folder must be on PATH. To add it for your user:
- Press Start, search for Edit environment variables for your account and open it.
- Select Path under User variables, choose Edit, then New, and paste the exact folder printed by
npm config get prefix. - Click OK on every dialog, close all terminals and VS Code, then open a new terminal and run
ng version.
If PowerShell then reports that ng.ps1 cannot be loaded because running scripts is disabled, that is a different error caused by the execution policy; see Angular PowerShell ng.ps1 cannot be loaded. Command Prompt is unaffected by it.
Step 3: Fix it on macOS and Linux
The shell prints zsh: command not found: ng or bash: ng: command not found. Install the CLI, then find the global bin folder:
npm install -g @angular/cli
echo "$(npm config get prefix)/bin"
echo $PATH
If the printed folder is not inside $PATH, add it to your shell profile (~/.zshrc on macOS, ~/.bashrc on most Linux systems). Replace the folder below with the one printed on your machine:
export PATH="$(npm config get prefix)/bin:$PATH"
source ~/.zshrc # or: source ~/.bashrc
If npm install -g fails with EACCES, do not use sudo. Follow npm’s guide to resolve EACCES permission errors: either use a Node version manager or point npm at a folder you own with npm config set prefix, then add that folder’s bin to PATH.
Use npx ng as a workaround
npx ships with npm. It runs a local CLI from node_modules/.bin if one exists, and otherwise downloads @angular/cli temporarily, so it needs no PATH change:
npx @angular/cli version
npx @angular/cli new my-app
# inside an existing project:
npx ng serve
This is useful to unblock yourself or to create a project, but fixing PATH is better for daily work.
Local vs global Angular CLI
A project created with ng new has @angular/cli in its devDependencies. Inside that project, npx ng and npm scripts such as npm start use the local copy, which is why npm start can work while a bare ng does not. The global copy is only the command that creates new projects and forwards to the local one. If the two versions differ, see global Angular CLI version is greater than local and this version of CLI is only compatible with Angular. The Angular local setup guide describes the supported install.
Which Node.js version does your Angular version need?
Angular lists the supported Node.js ranges on its versions reference. At the time of writing (checked against that page):
- Angular 22: Node.js ^22.22.3, ^24.15.0 or ^26.0.0.
- Angular 21: Node.js ^20.19.0, ^22.12.0 or ^24.0.0.
- Angular 20: Node.js ^20.19.0, ^22.12.0 or ^24.0.0.
An unsupported Node version usually produces a different error, but it is worth checking with node -v if the install itself fails. The page changes with each release, so confirm there before upgrading.
Other causes: nvm, permissions and VS Code
- nvm: global packages belong to one Node version. Run
nvm use <version>, thennpm install -g @angular/cliagain. On Windows this means nvm-windows, a separate project. - VS Code terminal: close every VS Code window and reopen it, or open a new terminal tab, so it picks up the new
PATH. Check which shell it uses in the terminal dropdown. - Several Node installs: run
where node(Windows) orwhich -a node(macOS/Linux) to see which one wins. - Corporate machine: if you cannot edit
PATHor install globally, usenpxor ask your administrator to allow the npm global folder.
More Angular CLI commands and errors are collected in Angular CLI common commands, errors and resolutions.
What was tested
The commands above follow npm and Angular documentation. They were not run in a live Windows, Linux or nvm environment while writing this update, and no Node.js is installed on the machine used to prepare it, so no command output is shown here. Verify each step on your own system with the checks in Step 1. The Node.js ranges were read from the Angular versions page.
Frequently asked questions
Why does ng work in one terminal but not another?
Each terminal reads PATH when it starts. Terminals opened before the install or the PATH change do not see it, and different shells (Command Prompt, PowerShell, Git Bash, VS Code) can use different settings. Open a new terminal and run ng version.
What is the correct package name for the Angular CLI?
It is @angular/cli. Install it with npm install -g @angular/cli. The old angular-cli package is obsolete.
Do I need to install the Angular CLI globally?
No. You can run npx @angular/cli new my-app to create a project and npx ng or npm scripts inside it. A global install only gives you the shorter ng command everywhere.
Summary
‘ng’ is not recognized means the shell cannot find the Angular CLI on PATH. Check node -v, npm -v and npm config get prefix, install @angular/cli globally, add the npm global folder to PATH, and open a new terminal. Use npx ng when you cannot change PATH, and check nvm, permissions and your VS Code terminal if it still fails.
Found this useful?
Bookmark this page and share it with your team. Get new .NET, cloud and database tutorials in your inbox.

This is nice. Perfectly resolved the issue
Thanks Dumindra. Glat it helped you!
Thank you. Worked for me !
If I will open a differnt user then run ng serve it’s giving me error
ng’ is not recognized as an internal or external command’
Hello Pankaj- Thanks for your query . Please set the User environment variable for every new user.
If you set those 2 variable as System environment variable then i think that should works even if you chnage the user.
I’ve change second user name but it’s still not working ?
Did you perform Angular CLI installation for new %USERPROFILE% as well? see if npm install -g @angular/cli@latest commands for new profile works for you.
You saved me a ton of time!..Thanks a lot!
Thanks Indu. Glad to help you!
Thanks, it worked for me.
Thanks, Harpreet for confirming. Appreciate it!
Thanks for sharing.
Thanks Dileep. Appreciate your comments.
Kudos to you .. worked for me after using Admin mode as mentioned and running all given command.
Thanks worked for me. Seriously, I struggled for this issue for almost 2 weeks.
Thank you ! It worked for me !!
Thanks Berut for your inputs.