0

difference between these commands

npm install -g angular-cli

npm install -g angular/cli

was trying to install angularcli using first command but it didn't get installed was getting error- AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-sass npm ERR! command failed

but when I tried the second command angular cli got installed.

Is there any difference between two commands

Unknown
  • 306
  • 1
  • 3
  • 16

2 Answers2

2

You get an error when using the first command npm install -g angular-cli because no such package exists with that name in the npm repository.

@angular/cli is the official package for installing CLI tool in Angular.

inkredusk
  • 919
  • 4
  • 16
1

I guess your're meaning npm install, not ng install ?

This difference is that the package name is @angular/cli. If you use another name, then you install another package (or nothing, if the name you provide is not taken).

https://www.npmjs.com/package/@angular/cli

MGX
  • 2,534
  • 2
  • 14
  • Yes I meant , npm install – Unknown Mar 30 '23 at 14:39
  • https://stackoverflow.com/questions/43344600/how-to-install-a-specific-version-of-angular-with-angular-cli here in the second answer it is mentioned to use these command npm uninstall -g angular-cli npm cache clean npm install -g angular-cli@1.0.0-beta.32 – Unknown Mar 30 '23 at 14:39
  • npm install -g angular-cli why there was no error that package didn't exist . if we use command with invalid package name does it install all the packages mentioned in the package.json? – Unknown Mar 30 '23 at 14:43
  • Yeah version 1. Angular is at version 17, which is 7 years later ... So just read the documentation next time. – MGX Mar 30 '23 at 19:08