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

Created on 7 Apr 2017  路  17Comments  路  Source: angular/angular-cli

Bug Report

Versions

Node v6.10.1
NPM 3.10.10
Windows 10

Repro steps

npm install -g @angular/cli@latest

The log given by the failure

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

Details

Hello, after installing angular-cli the 'ng' command simply doesn't work on windows.
There are other issues reporting this bug, but they don't have clear solutions.
Note: I don't have administrator access on this computer.

screnshoot

Most helpful comment

So I get this working by adding to my user account enviroment PATH:

For that go to :

Control Panel > User accounts > Change my environmnet variables

and add the path to your AppData\Roaming\npm, in my case was

C:\Users\fausto.braz\AppData\Roaming\npm

@MRokas thanks for the support 馃憤

All 17 comments

What does echo %PATH% return? And where did angular-cli get installed?

The echo %PATH% returns C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\TortoiseSVNbin;C:\Program Files\nodejs\;C:\Users\fausto.braz.dnxbin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Users\fausto.braz\AppData\Local\Microsoft\WindowsApps;C:\Users\fausto.braz\AppData\Localatombin

What about dir C:\Users\fausto.braz.dnx\AppData\Roaming\npm ?

Returns "The system cannot find the path specified."

Have you installed @angular/cli globally? Try npm install -g @angular/cli

@babilog yes, please read my first description --> Repro steps.

Hm.. what about dir %AppData%\npm\node_modules? -

@MRokas the command returns:

07/04/2017 11:11

.
07/04/2017 11:11 ..
07/04/2017 10:19 @angular
07/04/2017 11:06 gulp
07/04/2017 11:11 modular
07/04/2017 09:45 typescript

Any solution for this guys,?

Can't find anyone, to people without adiministrator access on windows ...

From what I see, your angular-cli didn't install properly, nor you've global's in your PATH variable.
You should find where your ng file is located at, and add that location to PATH variable.

@MRokas

In C:\Users\fausto.braz\AppData\Roaming\npm the commands are working.
cli

How can I add this to the windows PATH? (Windows noob here :D).

So I get this working by adding to my user account enviroment PATH:

For that go to :

Control Panel > User accounts > Change my environmnet variables

and add the path to your AppData\Roaming\npm, in my case was

C:\Users\fausto.braz\AppData\Roaming\npm

@MRokas thanks for the support 馃憤

Thanks for everyone that helped solve this, cheers!

At last find the solution for ng command is not working issue ,Find the solution below http://itechiesol.blogspot.com/2017/07/angular-cli-ng-command-is-not-working.html

thanks for the clean Solution for the Issue
it been an helpfull Resource :+1:

At last find the solution for ng command is not working issue ,Find the solution below http://itechiesol.blogspot.com/2017/07/angular-cli-ng-command-is-not-working.html

this helped me to resolve issue on windows 10.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sysmat picture sysmat  路  3Comments

delasteve picture delasteve  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

hartjo picture hartjo  路  3Comments