1

Tried to upgrade the angular from 11 to 13, here is my package.json. As I was using angular 11 which was having a slow build then I decided to upgrade it to 13 now it doesn't build or serve.

{
  "name": "metronic-angular-demo1",
  "version": "7.1.6x",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "rtl": "webpack --config webpack-rtl.config.js"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~11.0.0",
    "@angular/cdk": "^11.0.0",
    "@angular/common": "~11.0.0",
    "@angular/compiler": "~11.0.0",
    "@angular/core": "~11.0.0",
    "@angular/forms": "~11.0.0",
    "@angular/localize": "~11.0.0",
    "@angular/material": "^11.0.0",
    "@angular/material-moment-adapter": "^11.0.0",
    "@angular/platform-browser": "~11.0.0",
    "@angular/platform-browser-dynamic": "~11.0.0",
    "@angular/router": "~11.0.0",
    "@fortawesome/fontawesome-free": "^5.15.1",
    "@ng-bootstrap/ng-bootstrap": "^8.0.0",
    "@ngx-translate/core": "^13.0.0",
    "@types/jquery": "^3.5.5",
    "angular-froala-wysiwyg": "^3.2.5-2",
    "angular-in-memory-web-api": "^0.11.0",
    "apexcharts": "^3.20.0",
    "bootstrap": "^4.5.0",
    "clipboard": "^2.0.6",
    "highlight.js": "^9.17.1",
    "moment": "^2.27.0",
    "ng-apexcharts": "^1.5.1",
    "ng-inline-svg": "^10.1.0",
    "ngx-clipboard": "^13.0.1",
    "ngx-editor": "^7.0.3",
    "ngx-highlightjs": "3.0.3",
    "ngx-perfect-scrollbar": "^9.0.0",
    "object-path": "^0.11.4",
    "perfect-scrollbar": "^1.5.0",
    "rxjs": "~6.6.0",
    "socicon": "^3.0.5",
    "tslib": "^2.0.0",
    "yarn": "^1.22.17",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1100.1",
    "@angular/cli": "^13.2.5",
    "@angular/compiler-cli": "~11.0.0",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.8",
    "@types/node": "^14.11.10",
    "codelyzer": "^6.0.1",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~6.0.0",
    "karma": "~5.2.3",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.2",
    "webpack-cli": "^3.3.12",
    "webpack-messages": "^2.0.4",
    "webpack-rtl-plugin": "^2.0.0"
  }
}

now if I try to use ng serve then it shows like this. no output

no output is shown if I use it, using any build or serve shows no result at all.

1 Answers1

1

I faced similar issue while upgrading to angular 13. I resolved it by upgrading my angular-cli, you can directly upgrade your angular-cli version globally by using update command of ng. so you can do it by below command

ng update @angular/cli @angular/core

Now you can check the updated version using below cmd.

ng version

If the above method does not work another way is by using uninstalling and reinstalling angular cli. Follow below steps in order to completely uninstall old angular-cli and resinstall angular 13.

npm uninstall -g @angular/cli

npm cache clean --force

npm cache verify

npm install -g @angular/cli

again to verify version, use "ng version".

EdwardFunnyHands
  • 103
  • 2
  • 11
  • 1
    worked like this way `ng update @angular/cli@12--allow-dirty --force` --> `ng update @angular/cli@latest--allow-dirty --force` –  Mar 05 '22 at 19:51