试着理解npm的错误报告,但没有找到问题-令人惊讶的是,删除node_modules目录修复了它。我们正在将angular更新为18+,将nx更新为19+。
Found: @angular-devkit/[email protected]
node_modules/@angular-devkit/build-angular
dev @angular-devkit/build-angular@"18.0.4" from the root project
peer @angular-devkit/build-angular@">= 15.0.0 < 18.0.0" from @nx/[email protected]
node_modules/@nx/angular
@nx/angular@"19.3.0" from the root project
@nx/angular@"18.3.4" from @nrwl/[email protected]
node_modules/@nrwl/angular
@nrwl/angular@"18.3.4" from @nx/[email protected]
peer @angular-devkit/build-angular@">=15.0.0 <18.0.0" from [email protected]
node_modules/jest-preset-angular
dev jest-preset-angular@"14.1.1" from the root project
Could not resolve dependency:
dev @angular-devkit/build-angular@"18.0.4" from the root project
Conflicting peer dependency: @angular/[email protected]
node_modules/@angular/compiler-cli
peer @angular/compiler-cli@"^18.0.0" from @angular-devkit/[email protected]
node_modules/@angular-devkit/build-angular
dev @angular-devkit/build-angular@"18.0.4" from the root project
我如何理解最后一部分:
-
@角度devkit/
[email protected]
在package.json中找到
-
包与@angular/compiler cli@^18.0.0具有对等依赖关系
-
未能解析@angular/
[email protected]
(也在package.json中)
为什么它无法解决@angular问题/
[email protected]
什么时候它显然是一个有效的版本?
我如何理解第一部分:
-
[email protected]
在package.json中找到
-
该包的14.0.3版本具有对@angular devkit/build-angular@>=15.0.0<18.0.0
-
(解决基于错误版本范围的错误)
为什么npm使用旧版本的jest预设角度和nx/角度进行解析?它似乎忽略了package.json中指定的版本,并使用当前安装的版本。
(删除nod_modules来修复npm依赖性问题对我来说就像是npm本身的一个bug)
package.json
"dependencies": {
"@abp/ng.components": "8.1.3",
"@abp/ng.core": "8.1.3",
"@abp/ng.oauth": "8.1.3",
"@abp/ng.theme.shared": "8.1.3",
"@angular/animations": "18.0.3",
"@angular/common": "18.0.3",
"@angular/compiler": "18.0.3",
"@angular/core": "18.0.3",
"@angular/forms": "18.0.3",
"@angular/localize": "18.0.3",
"@angular/platform-browser": "18.0.3",
"@angular/platform-browser-dynamic": "18.0.3",
"@angular/router": "18.0.3",
"@ngrx/effects": "18.0.0",
"@ngrx/store": "18.0.0",
"@ngrx/operators": "18.0.0",
"@nx/angular": "19.3.0",
"@puschie286/golden-layout": "^2.6.2",
"@types/lodash-es": "^4.17.12",
"angular-oauth2-oidc": "^17.0.2",
"bootstrap-icons": "^1.11.3",
"lodash-es": "^4.17.21",
"primeicons": "^7.0.0",
"primeng": "^17.18.1",
"primeng-locale": "github:primefaces/primelocale",
"primeng-sass-theme": "github:primefaces/primeng-sass-theme",
"rxjs": "~7.8.1",
"ts-debounce": "^4.0.0",
"tslib": "^2.6.2",
"zone.js": "0.14.4"
},
"devDependencies": {
"@abp/ng.schematics": "^8.1.3",
"@abp/nx.generators": "^8.1.3",
"@angular-devkit/build-angular": "18.0.4",
"@angular-devkit/core": "18.0.4",
"@angular-devkit/schematics": "18.0.4",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular-eslint/template-parser": "18.0.1",
"@angular/cli": "~18.0.0",
"@angular/compiler-cli": "18.0.3",
"@angular/language-service": "18.0.3",
"@ngrx/eslint-plugin": "18.0.0",
"@ngrx/schematics": "18.0.0",
"@ngrx/store-devtools": "18.0.0",
"@nx-dotnet/core": "^2.2.0",
"@nx/cypress": "19.3.0",
"@nx/eslint": "19.3.0",
"@nx/eslint-plugin": "19.3.0",
"@nx/jest": "19.3.0",
"@nx/js": "19.3.0",
"@nx/plugin": "19.3.0",
"@nx/web": "19.3.0",
"@nx/workspace": "19.3.0",
"@schematics/angular": "18.0.4",
"@swc-node/register": "1.9.2",
"@swc/core": "1.5.7",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "7.3.0",
"@typescript-eslint/parser": "7.3.0",
"@typescript-eslint/utils": "^8.0.0-alpha.28",
"autoprefixer": "^10.4.17",
"cypress": "13.8.1",
"daisyui": "^4.6.3",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^2.15.1",
"jasmine-marbles": "~0.9.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-preset-angular": "14.1.1",
"jsonc-eslint-parser": "^2.4.0",
"nx": "19.3.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"ts-jest": "^29.1.2",
"ts-node": "10.9.2",
"typescript": "5.4.3"
}