angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

How to install the latest angular-cli?

Open zh-wowtv opened this issue 9 years ago • 25 comments

I found the latest version in github is 1.0.0-beta.30. But it always show my version is 1.0.0-beta.28.3 when I try:

sudo npm i -g angular-cli

What could be wrong? Thanks

zh-wowtv avatar Feb 03 '17 08:02 zh-wowtv

npm install -g @angular/cli@latest

diicar avatar Feb 03 '17 08:02 diicar

Docs need to be updated

bogacg avatar Feb 03 '17 08:02 bogacg

There is a pull request open for the docs: #4349

paumayr avatar Feb 03 '17 09:02 paumayr

You can run these two snippets to upgrade from angular-cli to the new package @angular/cli.

npm uninstall -g angular-cli
npm cache clean
npm install -g @angular/cli@latest
rm -rf node_modules dist
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install
ng update

grizzm0 avatar Feb 03 '17 09:02 grizzm0

@grizzm0 Are you not a fan of ng init? 😛

RicardoVaranda avatar Feb 03 '17 09:02 RicardoVaranda

@RicardoVaranda The README says ng update nowdays. ;) Pretty sure it used to say ng init tho.

grizzm0 avatar Feb 03 '17 09:02 grizzm0

Thanks. Previously I run: npm i -g angular-cli. I think this is the reason.

zh-wowtv avatar Feb 03 '17 09:02 zh-wowtv

I'll have to check it out properly, I like the way init makes the second part of your previous post much easier in my opinion I guess it's all a matter of preference :)

RicardoVaranda avatar Feb 03 '17 09:02 RicardoVaranda

@RicardoVaranda you still need to install the new version of the global cli via the npm commands.

itsnotvalid avatar Feb 03 '17 10:02 itsnotvalid

Of course, if you read my last comment I simply stated it makes the second part easier, the first part is essential regardless of your choice on upgrade.

RicardoVaranda avatar Feb 03 '17 10:02 RicardoVaranda

After installing latest version I still have a angular-cli folder with two folders inside

  • ast-tools
  • base-href-webpack

is this as defined?

elvirdolic avatar Feb 03 '17 12:02 elvirdolic

Closing as answered.

filipesilva avatar Feb 13 '17 13:02 filipesilva

First You uninstall the old version of the CLI globally, cleared cache, and then installed the new version CLI globally, following these instructions:

npm uninstall -g angular-cli @angular/cli

npm cache clean

npm install -g @angular/cli@latest

thavaselvama avatar Jul 22 '17 22:07 thavaselvama

Can anybody help me.I am unable to install CLI.

Mitali-Mahanta avatar Jul 30 '17 20:07 Mitali-Mahanta

What problem are you facing @Mitali-Mahanta

RicardoVaranda avatar Jul 31 '17 08:07 RicardoVaranda

Now @angular/cli is working,i reinstall the nodejs latest version(v6.11.1).

Mitali-Mahanta avatar Jul 31 '17 09:07 Mitali-Mahanta

This can help you to update the package versions of package.json to the last version https://www.npmjs.com/package/npm-check-updates

tokiodeo avatar Aug 24 '17 05:08 tokiodeo

https://github.com/angular/angular-cli#updating-angular-cli

karunakar1008 avatar Nov 03 '17 12:11 karunakar1008

After updating , my terminal shows angular CLI: 1.5.0 .

Is this the latest ?

vishal2develop avatar Nov 03 '17 20:11 vishal2develop

@vishal2develop Yes, if youre ever unsure you can check at the release tab: https://github.com/angular/angular-cli/releases

kenji-1996 avatar Nov 04 '17 00:11 kenji-1996