Skip to content

How to install the latest angular-cli? #4391

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

Closed
zh-wowtv opened this issue Feb 3, 2017 · 25 comments
Closed

How to install the latest angular-cli? #4391

zh-wowtv opened this issue Feb 3, 2017 · 25 comments

Comments

@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
Copy link

diicar commented Feb 3, 2017

npm install -g @angular/cli@latest

@bogacg
Copy link

bogacg commented Feb 3, 2017

Docs need to be updated

@paumayr
Copy link

paumayr commented Feb 3, 2017

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

@grizzm0
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
Copy link
Contributor

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

@grizzm0
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
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
Copy link
Contributor

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
Copy link

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

@RicardoVaranda
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

Closing as answered.

@thavaselvama
Copy link

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
Copy link

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

@RicardoVaranda
Copy link
Contributor

What problem are you facing @Mitali-Mahanta

@Mitali-Mahanta
Copy link

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

@antoc0d3
Copy link

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

@karunakar1008
Copy link

@vishal2develop
Copy link

After updating , my terminal shows angular CLI: 1.5.0 .

Is this the latest ?

@kenji-1996
Copy link

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

@rwmb
Copy link

rwmb commented Jan 15, 2018

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

@hassaniftikhar
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
Copy link

rwmb commented Jan 22, 2018

@hassaniftikhar check the comment below
#8798 (comment)

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

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests