angular-cli: 'ng' is not recognized as an internal or external command, operable program or batch file.

Am getting this at after setup

C:\Users\USER>ng --version ‘ng’ is not recognized as an internal or external command, operable program or batch file.

C:\Users\USER>node --version v6.9.5

Am using Windows 10/ 64 bit

Please provide us with the following information:


Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)


Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here:

Repro steps.

Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.

Thanks! We’ll be in touch soon.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (1 by maintainers)

Most upvoted comments

I just got a new computer (win 10) and experienced the same problem moving to new environment. I added %APPDATA%\npm to the PATH environment variable. That is where the ng command is (thanks emrhzc).

The problem is NOT the install of the NPM nor the path ! If you want to use the “ng” commend you need to install the angular-cli.

have the same problem after installing cli globally; “npm install -g @angular/cli” npm is working fine, suggesting it is among path variables. @LunaBawa, would you mind sharing your solution?

note: in my case the problem was that the above command for global cli installation puts ng into C:\Users\user\AppData\Roaming\npm, though it should see the installation as npm pointed in the build path; C:\Program Files\nodejs\node_modules\npm Adding the location in AppData into build variables solved the problem.

Thanks everyone i think i found a way around this might help?

Have a look at Yar’s answer for finding the npm path. The other answers for how to add that path to your Windows PATH environment variable.

This blog post helped me solved this problem.