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

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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

4 Comments

Yes I meant , npm install
stackoverflow.com/questions/43344600/… here in the second answer it is mentioned to use these command npm uninstall -g angular-cli npm cache clean npm install -g [email protected]
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?
Yeah version 1. Angular is at version 17, which is 7 years later ... So just read the documentation next time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.