I have recently upgraded my Angular 4 app to Angular 6 and now want to upgrade to Angular 7. According to the below article , running command the following command shouldn't take more than 10 mins to upgrade.
ng update @angular/cli @angular/core
https://blog.angular.io/version-7-of-angular-cli-prompts-virtual-scroll-drag-and-drop-and-more-c594e22e7b8c
I dont see anything happening on the command prompt after running this command. No errors. Could somebody tell me why this is happening
Run ng update @angular/core@12 @angular/cli@12 which should bring you to version 12 of Angular. Angular now requires TypeScript 4.2. ng update will update you automatically.
How do I upgrade ng to a specific version? ng updatelink To update to the next beta or pre-release version, use the –next=true option. To update from one major version to another, use the format ng update @angular/cli@^ @angular/core@^ .
Upgrade Angular CLI globally First, check your current Angular CLI version by running command. Note that if you run this command inside Angular project directory then you will get Angular project's version. If you run it outside Angular version then you will get global Angular CLI version.
I've updated 6 to 7 using:
Angular dependencies
npm install @angular/animations@latest @angular/common@latest @angular/compiler@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest --save
Angular dev dependencies
npm install @angular-devkit/build-angular@latest @angular/compiler-cli@latest @angular/cli@latest @angular/language-service@latest --save-dev
Dependencies; Core-js and Zone.js
npm install core-js@latest zone.js@latest --save
Dev dependencies; Types, codelyzer, karma tools, jasmine, protractor and tslint
npm install @types/jasmine@latest @types/node@latest codelyzer@latest karma@latest karma-chrome-launcher@latest karma-cli@latest karma-jasmine@latest karma-jasmine-html-reporter@latest jasmine-core@latest jasmine-spec-reporter@latest protractor@latest tslint@latest --save-dev
The new version 3+ of TypeScript
npm install typescript@latest --save-dev
Latest version 6+ of RxJS
npm install rxjs@latest rxjs-compat@latest --save
And:
npm install rxjs-tslint@latest --save-dev
Latest version 4+ of Webpack
npm install webpack@latest --save-dev
source
ANGULAR 6.1 to 7 MIGRATION PROCEDURE
In order to upgrade properly from Angular 6.1 to angular 7, you have to follow the next steps:
WARNING: Please check if all your imported modules are compatible with angular 7, upgrade them if necessary.
Before upgrade to Angular 7:
Change the HttpModule import to HttpClientModule (import {HttpClientModule} from '@angular/common/http';)
Change the Http imports (if you have any) to import {HttpClient} from '@angular/common/http';
Don´t forget to remove all JSON.parse(response), since you don´t need to do that anymore with HttpClient
If you are using RXjs, you have to remove RXjs 6 old dependencies. No worries, you can do that running the following scripts:
npm install -g rxjs-tslint
rxjs-5-to-6-migrate -p src/tsconfig.app.json
You may have to update typescript in order to migrate rxjs successfully: npm i -g typescript
If you use the Angular Service worker, migrate any versionedFiles to the files array.
Update angular cli to v7:
ng update @angular/cli
Update angular Core to v7:
ng update @angular/core
Finally you have to upgrade Angular material:
ng update @angular/material
here,you can find guide related to update from any version to angular 7
https://update.angular.io/
Or you can simply run a command into your CLI
ng update --all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With