Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update angular project from 5 to 7

I am trying to update my project from angular 5 to angular 7. For this first is update @angular/cli gloabaly and locally then I installed @angular/cli locally then update ng module and other related commands.

Now, I check my ng --version it is showing me angular 7, but my project is not running its always throwing below error: enter image description here

Below is my script in package.json file:

"scripts": {
"start": "cross-env NODE_ENV=development webpack-dev-server --port=9000 -- 
   content-base wwwroot/",
   "build": "cross-env NODE_ENV=development webpack --progress",
   "prod": "cross-env NODE_ENV=production webpack  --progress"
 }
like image 271
rohit13807 Avatar asked Oct 30 '18 13:10

rohit13807


People also ask

How do I upgrade my Angular project?

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.

How can I update my Angular project from 10 to 11?

As of now, going from Angular 10 to Angular 11 requires no changes to your current system. You need to run ng update @angular/core @angular/cli. It will push you to the Angular 11 update. The ng update part will automatically migrate you to TypeScript 4.0.


1 Answers

Steps of updating angular latest version 7:

1 ) You need to update your angular cli.

npm uninstall -g angular-cli
npm cache clean or npm cache verify 
npm install -g @angular/cli@latest

(c.f https://cli.angular.io/)

2) You need to upgrade your project version as per suggestion of angular update guide. Angular update guide website link Angular version upgrade guide website link (Click here)

3) On this website select your older version and your desired latest version after that click on 'Show me how to update'

4) After click on this button website provide a number of steps. You need to follow this step to upgrade your Angular version

like image 106
Suhag Lapani88 Avatar answered Sep 16 '22 15:09

Suhag Lapani88