Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install the latest angular-cli? #4391

Closed
zh-wowtv opened this Issue Feb 3, 2017 · 24 comments

Comments

Projects
None yet
@zh-wowtv
Copy link

zh-wowtv commented Feb 3, 2017

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

@diicar

This comment has been minimized.

Copy link

diicar commented Feb 3, 2017

npm install -g @angular/cli@latest

@bogacg

This comment has been minimized.

Copy link

bogacg commented Feb 3, 2017

Docs need to be updated

@paumayr

This comment has been minimized.

Copy link

paumayr commented Feb 3, 2017

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

@grizzm0

This comment has been minimized.

Copy link
Contributor

grizzm0 commented Feb 3, 2017

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
@RicardoVaranda

This comment has been minimized.

Copy link
Contributor

RicardoVaranda commented Feb 3, 2017

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

@grizzm0

This comment has been minimized.

Copy link
Contributor

grizzm0 commented Feb 3, 2017

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

@zh-wowtv

This comment has been minimized.

Copy link
Author

zh-wowtv commented Feb 3, 2017

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

@RicardoVaranda

This comment has been minimized.

Copy link
Contributor

RicardoVaranda commented Feb 3, 2017

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 :)

@itsnotvalid

This comment has been minimized.

Copy link

itsnotvalid commented Feb 3, 2017

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

@RicardoVaranda

This comment has been minimized.

Copy link
Contributor

RicardoVaranda commented Feb 3, 2017

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.

@elvirdolic

This comment has been minimized.

Copy link

elvirdolic commented Feb 3, 2017

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

  • ast-tools
  • base-href-webpack

is this as defined?

@filipesilva

This comment has been minimized.

Copy link
Member

filipesilva commented Feb 13, 2017

Closing as answered.

@thavaselvama

This comment has been minimized.

Copy link

thavaselvama commented Jul 22, 2017

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

@Mitali-Mahanta

This comment has been minimized.

Copy link

Mitali-Mahanta commented Jul 30, 2017

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

@RicardoVaranda

This comment has been minimized.

Copy link
Contributor

RicardoVaranda commented Jul 31, 2017

What problem are you facing @Mitali-Mahanta

@Mitali-Mahanta

This comment has been minimized.

Copy link

Mitali-Mahanta commented Jul 31, 2017

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

@jersonjcnt

This comment has been minimized.

Copy link

jersonjcnt commented Aug 24, 2017

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

@vicpeters vicpeters referenced this issue Aug 29, 2017

Open

Latest CLI #14

@karunakar1008

This comment has been minimized.

@vishal2develop

This comment has been minimized.

Copy link

vishal2develop commented Nov 3, 2017

After updating , my terminal shows angular CLI: 1.5.0 .

Is this the latest ?

@kenji-1996

This comment has been minimized.

Copy link

kenji-1996 commented Nov 4, 2017

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

@rwmb

This comment has been minimized.

Copy link

rwmb commented Jan 15, 2018

@grizzm0 npm uninstall -g angular-cli missing the @ at angular-cli.
Thanks for the help!

@hassaniftikhar

This comment has been minimized.

Copy link

hassaniftikhar commented Jan 19, 2018

Hey Guys,
Simple things here
I ran

npm install -g @angular/cli
ng new my-app
cd my-app
ng serve

ERROR in Error: No NgModule metadata found for 'AppModule'.
at NgModuleResolver.resolve (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/compiler/bundles/compiler.umd.js:20277:23)
at CompileMetadataResolver.getNgModuleMetadata (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/compiler/bundles/compiler.umd.js:15230:60)
at visitLazyRoute (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/compiler/bundles/compiler.umd.js:31169:104)
at AotCompiler.listLazyRoutes (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/compiler/bundles/compiler.umd.js:31137:20)
at AngularCompilerProgram.listLazyRoutes (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/compiler-cli/src/transformers/program.js:156:30)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/compiler-cli/src/ngtools_api.js:44:36)
at AngularCompilerPlugin._getLazyRoutesFromNgtools (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:248:66)
at Promise.resolve.then.then (/Users/hassaniftikhar/RubymineProjects/angular-projects/my-app/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:565:50)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

ng -v

Angular CLI: 1.6.5
Node: 8.2.1
OS: darwin x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.5
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@ngtools/json-schema: 1.1.0
typescript: 2.5.3
webpack: 3.10.0

@rwmb

This comment has been minimized.

Copy link

rwmb commented Jan 22, 2018

@hassaniftikhar check the comment below
#8798 (comment)

@captainhook99999

This comment has been minimized.

Copy link

captainhook99999 commented Mar 20, 2018

I've solved it after running following instructions!
npm install npm -g
npm install --save-dev @angular/cli@latest
npm install
npm start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.