angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

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

Open fstbraz opened this issue 9 years ago • 17 comments

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

fstbraz avatar Apr 07 '17 09:04 fstbraz

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

MRokas avatar Apr 07 '17 09:04 MRokas

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\TortoiseSVN\bin;C:\Program Files\nodejs;C:\Users\fausto.braz.dnx\bin;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\Local\atom\bin

fstbraz avatar Apr 07 '17 10:04 fstbraz

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

MRokas avatar Apr 07 '17 10:04 MRokas

Returns "The system cannot find the path specified."

fstbraz avatar Apr 07 '17 10:04 fstbraz

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

babilog avatar Apr 07 '17 10:04 babilog

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

fstbraz avatar Apr 07 '17 11:04 fstbraz

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

MRokas avatar Apr 07 '17 11:04 MRokas

@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

fstbraz avatar Apr 10 '17 09:04 fstbraz

Any solution for this guys,?

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

fstbraz avatar Apr 11 '17 10:04 fstbraz

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 avatar Apr 11 '17 10:04 MRokas

@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).

fstbraz avatar Apr 11 '17 10:04 fstbraz

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 👍

fstbraz avatar Apr 11 '17 11:04 fstbraz

Thanks for everyone that helped solve this, cheers!

filipesilva avatar May 04 '17 15:05 filipesilva

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

naru6be avatar Jul 22 '17 13:07 naru6be

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

ETL-Corp avatar Sep 05 '17 13:09 ETL-Corp

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.

RahulSolanki1487 avatar Sep 11 '18 19:09 RahulSolanki1487

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.