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 LunaBawa opened this issue 9 years ago • 24 comments

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:

OS?

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

Versions.

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.

LunaBawa avatar Feb 05 '17 18:02 LunaBawa

Either you haven't installed the CLI globally or you haven't added your NPM home dir to your PATH?

david-bulte avatar Feb 05 '17 19:02 david-bulte

image

Please, how do i add NPM home dir to my path?

LunaBawa avatar Feb 05 '17 19:02 LunaBawa

http://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8 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.

david-bulte avatar Feb 05 '17 20:02 david-bulte

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.

https://cli.angular.io/

eran12 avatar Feb 06 '17 13:02 eran12

like @eran12 said it doesn't look like you have @angular/cli installed. verify that the installation was completed successfully.

deebloo avatar Feb 06 '17 16:02 deebloo

Thanks everyone i think i found a way around this

LunaBawa avatar Feb 07 '17 15:02 LunaBawa

@LunaBawa Would you share please?

RBroden avatar Apr 04 '17 17:04 RBroden

Would you please share?

belall-shaikh avatar Apr 13 '17 09:04 belall-shaikh

yep! share is good!

I believe his solution is to install @angular/cli

this documentation would help : Angular CLI Quickstart

aghArdeshir avatar Apr 16 '17 04:04 aghArdeshir

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.

ezci avatar Jun 13 '17 07:06 ezci

Just open your command prompt (run as administrator). Ensure node --v is 6.9.0 or higher and npm --v is 3.0.0 r higher.

After that run the following command:

npm install -g @angular/cli

Once angular is installed. you can see an entry of angular cli in the path

C:\Users\Dell\AppData\Roaming\npm\node_modules@angular

Then try ng help. It will work.

gautamjgithub avatar Jun 28 '17 13:06 gautamjgithub

it doesn't do for me. any other suggestions?

Elichii avatar Jul 07 '17 17:07 Elichii

I am having the same issue, and I am using Windows 7 home premium.

raferbop avatar Jul 07 '17 20:07 raferbop

Hi Friends! 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

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

PHuhn avatar Jul 23 '17 20:07 PHuhn

This blog post helped me solved this problem. http://ovinitech.blogspot.ru/2017/08/ng-is-not-recognized-as-internal-or.html

alfmoh avatar Dec 04 '17 16:12 alfmoh

emrhzc's solution worked, thank you!

richardmpadre avatar Dec 08 '17 15:12 richardmpadre

thanks emrhzc。I met the same problem and now I've solved it.

StruggleYang avatar Dec 12 '17 06:12 StruggleYang

I tried to install via npm and the following error given by the terminal

λ npm install -g @angular/cli
npm ERR! Unexpected end of JSON input while parsing near '...erify":"latest","@typ'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Priya Ranjan Dubey\AppData\Roaming\npm-cache\_logs\2018-09-17T10_54_38_949Z-debug.log

the angular-cli was installed using yarn but after running ng --version ng was not recognized

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

What to do?

TechiePriyaRanjan avatar Sep 17 '18 11:09 TechiePriyaRanjan

Hey Techie: It seem you are on a windows computer. Verify that CLI is installed:

> CD %APPDATA%\npm
> ng --version

If installed configure your local PATH to include the above folder.

PHuhn avatar Sep 17 '18 14:09 PHuhn