npm 最新的Angular 包. json

rdlzhqv9  于 2022-11-14  发布在  Angular
关注(0)|答案(1)|浏览(159)

我试图保持我的应用程序的最新版本的Angular和每次我试图更新到最新版本的Angular组件,我得到相同的错误...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: salarizare@0.0.0
npm ERR! Found: @angular-devkit/build-angular@14.2.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   @angular-devkit/build-angular@"14.2.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @angular-devkit/build-angular@"14.2.6" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/compiler@14.2.7
npm ERR! node_modules/@angular/compiler
npm ERR!   peer @angular/compiler@"14.2.7" from @angular/localize@14.2.7
npm ERR!   node_modules/@angular/localize
npm ERR!     @angular/localize@"14.2.7" from the root project
npm ERR!     peerOptional @angular/localize@"^14.0.0" from @angular-devkit/build-angular@14.2.6
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       @angular-devkit/build-angular@"14.2.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\User 12\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User 12\AppData\Local\npm-cache\_logs\2022-10-21T11_58_38_546Z-debug-0.log

我的package.json看起来是这样的(所有的东西都在最新的版本上...)

{
  "name": "salarizare",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/build-angular": "14.2.6",
    "@angular/animations": "14.2.7",
    "@angular/cdk": "14.2.5",
    "@angular/common": "14.2.7",
    "@angular/compiler": "14.2.7",
    "@angular/compiler-cli": "14.2.7",
    "@angular/core": "14.2.7",
    "@angular/forms": "14.2.7",
    "@angular/localize": "14.2.7",
    "@angular/material": "14.2.5",
    "@angular/platform-browser": "14.2.7",
    "@angular/platform-browser-dynamic": "14.2.7",
    "@angular/router": "14.2.7",
    "@fortawesome/angular-fontawesome": "0.11.1",
    "@fortawesome/fontawesome-svg-core": "^6.2.0",
    "@fortawesome/free-brands-svg-icons": "^6.2.0",
    "@fortawesome/free-regular-svg-icons": "^6.2.0",
    "@fortawesome/free-solid-svg-icons": "^6.2.0",
    "@ng-bootstrap/ng-bootstrap": "^13.1.0",
    "@ng-select/ng-select": "9.0.2",
    "@popperjs/core": "^2.11.6",
    "@types/async": "^3.2.15",
    "@types/jquery": "^3.5.14",
    "@types/lodash": "^4.14.186",
    "@types/toastr": "^2.1.40",
    "ace-builds": "1.12.3",
    "angular2-hotkeys": "^13.1.0",
    "async": "^3.2.4",
    "axios": "^1.1.3",
    "bootstrap": "5.2.2",
    "core-js": "^3.25.5",
    "dayjs": "^1.11.6",
    "fast-xml-parser": "^4.0.11",
    "jquery": "^3.6.1",
    "lodash": "^4.17.21",
    "ng-table-virtual-scroll": "^1.4.1",
    "ngx-bootstrap": "^9.0.0",
    "ngx-editor": "15.0.1",
    "ngx-infinite-scroll": "14.0.0",
    "ngx-socket-io": "4.3.1",
    "ngx-spinner": "14.0.0",
    "ngx-toastr": "^15.2.1",
    "reflect-metadata": "^0.1.13",
    "rxjs": "7.5.7",
    "tslib": "^2.4.0",
    "typescript": "4.8.4",
    "xlsx-js-style": "^1.2.0",
    "zone.js": "^0.11.8"
  },
  "devDependencies": {
    "@angular/cli": "14.2.6",
    "@types/jasmine": "^4.3.0",
    "@types/node": "^18.11.3",
    "jasmine-core": "^4.4.0",
    "karma": "^6.4.1",
    "karma-chrome-launcher": "^3.1.1",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0"
  },
  "browser": {
    "os": false
  }
}

我错过了什么吗?:(如果我降级到一个旧版本,一切都工作得很好...顺便说一句,我从14.0.0更新到14.2.6/7,所以它不应该是这样一个巨大的飞跃,如果我没有错...会是一个问题,从NPM?)
编辑:如果我尝试使用~14.0.0,我会得到以下冲突xD

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: salarizare@0.0.0
npm ERR! Found: typescript@4.8.4
npm ERR! node_modules/typescript
npm ERR!   typescript@"4.8.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=4.6.2 <4.8" from @angular/compiler-cli@14.0.7
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   @angular/compiler-cli@"~14.0.0" from the root project
npm ERR!   peer @angular/compiler-cli@"^14.0.0" from @angular-devkit/build-angular@14.0.7
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     @angular-devkit/build-angular@"~14.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\User 12\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User 12\AppData\Local\npm-cache\_logs\2022-10-21T12_32_32_151Z-debug-0.log
pvcm50d1

pvcm50d11#

运行时间:

  1. npm uninstall -g angular-cli
  2. npm cache clean or npm cache verify (if npm > 5)
  3. npm install -g @angular/cli@latest
  • 这是一个很好的例子,它可以帮助你更好的理解和理解你的观点。
  • 我仍然收到编译器本地化和引导错误...

相关问题