0

command-line text:


C:\Users\User\Desktop>npm install -g @angular/cli

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

C:\Users\User\AppData\Roaming\npm\ng -> C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

@angular/cli@10.1.7 postinstall C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli

node ./bin/postinstall/script.js

@angular/cli@10.1.7
added 276 packages from 206 contributors in 333.421s

C:\Users\User\Desktop>ng new contacts
'ng' is not recognized as an internal or external command,
operable program or batch file.

Already tried:

  1. Added angular to path variables.
  2. manually delete npm directory in AppData/Roaming
  3. npm clean cache --force
R. Richards
  • 24,603
  • 10
  • 64
  • 64
muazzam
  • 13
  • 5

1 Answers1

0

first of all you have to install latest node packages then you don't need to install angular packages locally

just use npx before ng in every command

npx ng new newApp
npx ng serve
npx ng generate component login
npx ng ...

this is will work for you.

Miyas Mohammed
  • 476
  • 3
  • 10