Unable to resolve dependency tree error when installing npm packages

博客围绕npm包安装时出现依赖树错误展开,虽未给出具体内容,但可知聚焦于该信息技术领域问题。
npm install --legacy-peer-deps
UPDATE src/app/app.html (287 bytes) ⠴ Installing packages (npm)...npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: ng-zorro-antd@20.3.1 npm error Found: @angular/core@20.3.0 npm error node_modules/@angular/core npm error @angular/core@"^20.2.0" from the root project npm error peerOptional @angular/core@"^20.0.0" from @angular/build@20.3.1 npm error node_modules/@angular/build npm error dev @angular/build@"^20.2.2" from the root project npm error 7 more (@angular/cdk, @angular/common, @angular/forms, ...) npm error npm error Could not resolve dependency: npm error peer @angular/animations@"^20.0.0" from ng-zorro-antd@20.3.1 npm error node_modules/ng-zorro-antd npm error ng-zorro-antd@"^20.3.1" from the root project npm error npm error Conflicting peer dependency: @angular/core@20.3.1 npm error node_modules/@angular/core npm error peer @angular/core@"20.3.1" from @angular/animations@20.3.1 npm error node_modules/@angular/animations npm error peer @angular/animations@"^20.0.0" from ng-zorro-antd@20.3.1 npm error node_modules/ng-zorro-antd npm error ng-zorro-antd@"^20.3.1" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\BIM01\AppData\Local\npm-cache\_logs\2025-09-18T07_13_45_823Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\BIM01\AppData\Local\npm-cache\_logs\2025-09-18T07_13_45_823Z-debug-0.log ✖ Package install failed, see above. The Schematic workflow failed. See above.
09-19
G:\大二\下\Angluar\LING>ng new Fu √ Which stylesheet format would you like to use? CSS [ https://developer.mozilla.org/docs/Web/CSS ] √ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? Yes √ Would you like to use the Server Routing and App Engine APIs (Developer Preview) for this server application? Yes CREATE Fu/angular.json (2830 bytes) CREATE Fu/package.json (1216 bytes) CREATE Fu/README.md (1525 bytes) CREATE Fu/tsconfig.json (942 bytes) CREATE Fu/.editorconfig (331 bytes) CREATE Fu/.gitignore (629 bytes) CREATE Fu/tsconfig.app.json (508 bytes) CREATE Fu/tsconfig.spec.json (449 bytes) CREATE Fu/.vscode/extensions.json (134 bytes) CREATE Fu/.vscode/launch.json (490 bytes) CREATE Fu/.vscode/tasks.json (980 bytes) CREATE Fu/src/main.ts (256 bytes) CREATE Fu/src/index.html (301 bytes) CREATE Fu/src/styles.css (81 bytes) CREATE Fu/src/main.server.ts (271 bytes) CREATE Fu/src/server.ts (1702 bytes) CREATE Fu/src/app/app.component.html (20239 bytes) CREATE Fu/src/app/app.component.spec.ts (933 bytes) CREATE Fu/src/app/app.component.ts (290 bytes) CREATE Fu/src/app/app.component.css (0 bytes) CREATE Fu/src/app/app.config.ts (447 bytes) CREATE Fu/src/app/app.routes.ts (80 bytes) CREATE Fu/src/app/app.config.server.ts (509 bytes) CREATE Fu/src/app/app.routes.server.ts (174 bytes) CREATE Fu/public/favicon.ico (15086 bytes) \ Installing packages (npm)...npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: fu@0.0.0 npm error Found: @angular/common@19.2.9 npm error node_modules/@angular/common npm error @angular/common@"^19.2.0" from the root project npm error peer @angular/common@"^19.0.0 || ^19.2.0-next.0" from @angular/ssr@19.2.11 npm error node_modules/@angular/ssr npm error @angular/ssr@"^19.2.11" from the root project npm error 3 more (@angular/platform-server, @angular/platform-browser, @angular/animations) npm error npm error Coul
05-14
G:\大二\下\Angluar\LING>ng new Fu √ Which stylesheet format would you like to use? CSS [ https://developer.mozilla.org/docs/Web/CSS ] √ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? Yes √ Would you like to use the Server Routing and App Engine APIs (Developer Preview) for this server application? Yes CREATE Fu/angular.json (2830 bytes) CREATE Fu/package.json (1216 bytes) CREATE Fu/README.md (1525 bytes) CREATE Fu/tsconfig.json (942 bytes) CREATE Fu/.editorconfig (331 bytes) CREATE Fu/.gitignore (629 bytes) CREATE Fu/tsconfig.app.json (508 bytes) CREATE Fu/tsconfig.spec.json (449 bytes) CREATE Fu/.vscode/extensions.json (134 bytes) CREATE Fu/.vscode/launch.json (490 bytes) CREATE Fu/.vscode/tasks.json (980 bytes) CREATE Fu/src/main.ts (256 bytes) CREATE Fu/src/index.html (301 bytes) CREATE Fu/src/styles.css (81 bytes) CREATE Fu/src/main.server.ts (271 bytes) CREATE Fu/src/server.ts (1702 bytes) CREATE Fu/src/app/app.component.html (20239 bytes) CREATE Fu/src/app/app.component.spec.ts (933 bytes) CREATE Fu/src/app/app.component.ts (290 bytes) CREATE Fu/src/app/app.component.css (0 bytes) CREATE Fu/src/app/app.config.ts (447 bytes) CREATE Fu/src/app/app.routes.ts (80 bytes) CREATE Fu/src/app/app.config.server.ts (509 bytes) CREATE Fu/src/app/app.routes.server.ts (174 bytes) CREATE Fu/public/favicon.ico (15086 bytes) - Installing packages (npm)...npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: fu@0.0.0 npm error Found: @angular/common@19.2.9 npm error node_modules/@angular/common npm error @angular/common@"^19.2.0" from the root project npm error peer @angular/common@"^19.0.0 || ^19.2.0-next.0" from @angular/ssr@19.2.11 npm error node_modules/@angular/ssr npm error @angular/ssr@"^19.2.11" from the root project npm error 3 more (@angular/platform-server, @angular/platform-browser, @angular/animations) npm error npm error Coul
05-14
PS E:\project\Demo> ng add ng-zorro-antd Skipping installation: Package already installed ✔ Enable icon dynamic loading [ Detail: https://ng.ant.design/components/icon/en ] No ✔ Set up custom theme file [ Detail: https://ng.ant.design/docs/customize-theme/en ] No ✔ Choose your locale code: zh_CN ✔ Choose template to create project: blank UPDATE src/app/app.html (287 bytes) ⠏ Installing packages (npm)...npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: ng-zorro-antd@20.3.1 npm error Found: @angular/core@20.3.0 npm error node_modules/@angular/core npm error @angular/core@"^20.2.0" from the root project npm error peerOptional @angular/core@"^20.0.0" from @angular/build@20.3.1 npm error node_modules/@angular/build npm error dev @angular/build@"^20.2.2" from the root project npm error 7 more (@angular/cdk, @angular/common, @angular/forms, ...) npm error npm error Could not resolve dependency: npm error peer @angular/animations@"^20.0.0" from ng-zorro-antd@20.3.1 npm error node_modules/ng-zorro-antd npm error ng-zorro-antd@"^20.3.1" from the root project npm error npm error Conflicting peer dependency: @angular/core@20.3.1 npm error node_modules/@angular/core npm error peer @angular/core@"20.3.1" from @angular/animations@20.3.1 npm error node_modules/@angular/animations npm error peer @angular/animations@"^20.0.0" from ng-zorro-antd@20.3.1 npm error node_modules/ng-zorro-antd npm error ng-zorro-antd@"^20.3.1" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\BIM01\AppData\Local\npm-cache\_logs\2025-09-18T07_21_31_054Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\BIM01\AppData\Local\npm-cache\_logs\2025-09-18T07_21_31_054Z-debug-0.log ✖ Package install failed, see above. The Schematic workflow failed. See above.
09-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值