جاوااسکریپت - Unable to update نسخه Angular


من دارم تلاش میکنم برنامه انگولار خود را ارتقا دهم. نسخه برنامه انگولار من ۴.۲.۴ برای برنامههای پایه است. من از مراحلی که در راهنمای بهروزرسانی انگولار داده شده است استفاده میکنم.

طبق راهنما من باید دستورهای زیر را اجرا کنم

npm install -g @angular/cli
npm install @angular/cli
ng update @angular/cli

اما وقتی سعی کردم دستور را اجرا کنم

ng update @angular/cli

این به من خطا میدهد که میگوید

Error: Cannot update safely because packages have conflicting dependencies. Package @angular/core would need to match both versions "7.2.15" and "8.2.7, which are not compatible.
Cannot update safely because packages have conflicting dependencies. Package @angular/core would need to match both versions "7.2.15" and "8.2.7, which are not compatible.

این شکل package.json من است

{
  "name": "stellar",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "angular2-jwt": "^0.2.3",
    "chart.js": "^2.7.2",
    "core-js": "^2.4.1",
    "jquery": "^3.3.1",
    "ng2-archwizard": "^2.1.0",
    "ng2-charts": "^1.6.0",
    "ng2-toastr": "^4.1.2",
    "ng2-validation": "^4.2.0",
    "ngx-bootstrap": "^2.0.5",
    "npm": "^6.2.0",
    "rxjs": "^5.4.2",
    "slick-carousel": "^1.8.1",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "^1.7.4",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/language-service": "^4.2.4",
    "@types/c3": "^0.6.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "c3": "^0.6.2",
    "codelyzer": "~3.2.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "^2.0.5",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.0",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "~2.3.3"
  }
}

آیا کسی میتواند کمک کند تا این مشکل حل شود

پاسخ شماره ۱

فکر میکنم میتوانی این آموزش را دنبال کنی

یا نسخه بسته انگولار خود را بهصورت دستی به چیزی شبیه این بهروزرسانی کنید

"@angular/core": "~8.2.4"

فایل tsconfig.json خود را مانند این بهروزرسانی کنید

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext", // add this line
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",// add this line
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

بهروزرسانی :

نصب rxjs-compact مشکل را حل میکند

پاسخ شماره ۲

این آموزش را دنبال کنید یا دستورات زیر را اجرا کنید:

#Install npm-check-updates
npm i -g npm-check-updates
 
#Run npm-check-updates with -u, will upgrade package.json
ncu -u
 
#Install updated packages
npm install

#Then run
npm install [email