2

I am upgrading my Angular project from version 10.2.x to version 11. As per official angular update guide, when I run the command

ng update @angular/core@11 @angular/cli@11 --allow-dirty --force

it throws following error:

enter image description here

My package.json file looks like below:

  "private": true,
  "dependencies": {
    "@agm/core": "3.0.0-beta.0",
    "@angular/animations": "11.2.14",
    "@angular/cdk": "11.2.13",
    "@angular/common": "11.2.14",
    "@angular/compiler": "11.2.14",
    "@angular/core": "11.2.14",
    "@angular/flex-layout": "9.0.0-beta.31",
    "@angular/forms": "11.2.14",
    "@angular/localize": "11.2.14",
    "@angular/material": "11.2.13",
    "@angular/platform-browser": "11.2.14",
    "@angular/platform-browser-dynamic": "11.2.14",
    "@angular/router": "11.2.14",
    "@ng-idle/core": "9.0.0-beta.1",
    "@ng-idle/keepalive": "9.0.0-beta.1",
    "@ngx-formly/core": "5.9.3",
    "@ngx-formly/material": "5.9.3",
    "@reachplatform/core": "1.0.0",
    "@types/googlemaps": "3.39.12",
    "angular2-moment": "1.9.0",
    "classlist.js": "1.1.20150312",
    "compression": "1.7.4",
    "concurrently": "5.3.0",
    "core-js": "3.6.5",
    "deprecated-decorator": "0.1.6",
    "dotenv": "8.2.0",
    "express": "4.17.1",
    "hammerjs": "2.0.8",
    "helmet": "4.1.0",
    "html2canvas": "1.0.0-rc.5",
    "jspdf": "2.3.1",
    "mime": "2.4.6",
    "morgan": "1.10.0",
    "ng-recaptcha": "5.0.0",
    "ngx-cookie-service": "10.0.1",
    "ngx-mask": "9.1.2",
    "ngx-pagination": "5.0.0",
    "ngx-trim-directive": "1.0.11",
    "nocache": "2.1.0",
    "rxjs": "6.6.2",
    "rxjs-compat": "6.6.2",
    "tslib": "^2.0.0",
    "web-animations-js": "2.3.2",
    "zone.js": "0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.1102.19",
    "@angular-eslint/eslint-plugin": "0.0.1-alpha.32",
    "@angular/cli": "11.2.19",
    "@angular/compiler-cli": "11.2.14",
    "@angular/language-service": "11.2.14",
    "@compodoc/compodoc": "^1.1.11",
    "@types/jest": "^26.0.15",
    "@types/node": "^14.6.7",
    "@typescript-eslint/eslint-plugin": "^3.9.1",
    "@typescript-eslint/eslint-plugin-tslint": "^3.9.1",
    "@typescript-eslint/parser": "^3.9.1",
    "codelyzer": "^6.0.0",
    "eslint": "^7.7.0",
    "eslint-plugin-import": "^2.22.0",
    "jest": "^26.6.1",
    "jest-canvas-mock": "^2.3.0",
    "jest-preset-angular": "^8.3.2",
    "jest-sonar": "^0.2.11",
    "protractor": "~7.0.0",
    "ts-jest": "^26.4.3",
    "ts-node": "^9.0.0",
    "tslint": "~6.1.0",
    "typescript": "^4.1.6"
  }
}

The command did upgrade required dependencies to version 11 but threw error too. I tried looking for a solution on internet, but didn't find much. After this when I run the mentioned command to upgrade angular-material, I see the version upgraded but also the same error again.

James Z
  • 12,209
  • 10
  • 24
  • 44
Raj
  • 83
  • 10

1 Answers1

2

It has to do something with the versions of ts-node and typescript. I don't know exactly why, but these changes in the package.json worked for me:

"ts-node": "~10.7.0"
"typescript": "~4.6.4"
SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Tsujmi
  • 31
  • 6