![](/img/trans.png)
[英]Updating Angular 8 to Angular 9 unable to resolve dependency tree
[英]Unable to resolve dependency tree
我在項目中遇到依賴項問題。 以下是我在嘗試更新包時收到的錯誤代碼。 我還將依賴項的代碼粘貼到“package.json”文件中。
ERROR CODE
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: grocery-shop@0.0.0
npm ERR! Found: @typescript-eslint/eslint-plugin@5.47.1
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^5.47.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"^4.0.1" from eslint-config-standard-with-typescript@21.0.1
npm ERR! node_modules/eslint-config-standard-with-typescript
npm ERR! dev eslint-config-standard-with-typescript@"^21.0.1" 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 /home/pk/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pk/.npm/_logs/2022-12-29T13_36_27_051Z-debug-0.log
package.json file
"devDependencies": {
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@nrwl/eslint-plugin-nx": "15.3.3",
"@nrwl/jest": "15.3.3",
"@nrwl/linter": "15.3.3",
"@nrwl/nest": "^15.3.3",
"@nrwl/node": "15.3.3",
"@nrwl/nx-cloud": "latest",
"@nrwl/workspace": "15.3.3",
"@types/jest": "28.1.1",
"@types/node": "18.7.1",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "^8.30.0",
"eslint-config-prettier": "8.1.0",
"eslint-config-standard-with-typescript": "^21.0.1",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-promise": "^6.1.1",
"husky": "^8.0.0",
"jest": "28.1.1",
"jest-environment-jsdom": "28.1.1",
"lint-staged": "^13.1.0",
"nx": "15.3.3",
"prettier": "^2.6.2",
"prisma": "^4.8.0",
"ts-jest": "28.0.5",
"ts-node": "10.9.1",
"typescript": "^4.9.4"
}
我嘗試將“audit fix”命令或“npm install”/“update”與“--force”和“--legacy-peer-deps”一起使用,但問題仍然存在。 你們知道如何解決這個問題嗎? 哪些依賴項是問題所在,要更改到哪些版本?
從他們的變更日志來看,我猜你需要使用eslint-config-standard-with-typescript
版本 22 及更高版本。 版本 24 兩周前剛剛發布,並且明確地將@typescript-eslint/eslint-plugin
設置為足夠高的版本。 回到具有該版本的最舊提交,如果您想要最舊的兼容版本,您應該使用npm install --save-dev eslint-config-standard-with-typescript@^22
或僅npm install --save-dev eslint-config-standard-with-typescript@latest
獲取最新版本
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.