2

I am trying to install Angular CLI using the command npm install -g @angular/cli but, I am getting the below error when I type ng in the command prompt.

'ng' is not recognized as an internal or external command

command prompt output

>npm install -g @angular/cli
npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
P:\Users\Test\AppData\Roaming\npm\ng -> P:\Users\Test\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

> @angular/cli@11.0.2 postinstall P:\Users\Test\AppData\Roaming\npm\node_modules\@angular\cli
> node ./bin/postinstall/script.js

+ @angular/cli@11.0.2
updated 1 package in 8.436s

Below are the node and npm versions.

>node -v
v12.18.2

>npm -v
6.14.5
Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197
  • Try this: https://stackoverflow.com/questions/37991556/ng-is-not-recognized-as-an-internal-or-external-command – Bar Levin Dec 01 '20 at 12:43
  • If you are running it into Powershell, then you should try run `Set-ExecutionPolicy Unrestricted -Scope CurrentUser`, restart your Powershell, and after, run `ng --version`. – viniciusmfelix Dec 01 '20 at 12:50
  • Were you, previously, able to use other NPM command installed globally ? If not, maybe the global `node_modules` folder is not part of your path. – Nicolas Dec 01 '20 at 12:50

1 Answers1

0

Install angular forcefully with this:

npm install -g @angular/cli --force
Pang
  • 9,564
  • 146
  • 81
  • 122
Puneet
  • 1