Angular 通用依赖问题

问题描述 投票:0回答:1

我正在使用 Angular 构建这个项目,当“ng 添加”Angular Universal时,会发生此依赖项错误:

$ ng add @nestjs/ng-universal                                                                                                              
ℹ Using package manager: npm
✔ Found compatible package version: @nestjs/[email protected].
✔ Package information loaded.

The package @nestjs/[email protected] will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/animations
npm ERR!   @angular/animations@"15.2.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"15.2.8" from @angular/[email protected]
npm ERR! node_modules/@angular/platform-server
npm ERR!   peer @angular/platform-server@"^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0" from @nestjs/ng-univer[email protected]
npm ERR!   node_modules/@nestjs/ng-universal
npm ERR!     @nestjs/ng-universal@"7.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\Ferra\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\Ferra\AppData\Local\npm-cache\_logs\2023-04-29T11_48_03_200Z-debug-0.log
✖ Packages installation failed, see above.

我尝试删除 package-lock 和 node_modules,并将所有 @Angular 依赖项更改为 15.2.1(最新的 Angular Universal 发行版本),但没有成功。这个[NestJs版本](https://github.com/nestjs/ng-universal)给了我同样的问题。 我只是不知道如何解决这个问题。 预先感谢。

angular node-modules package.json angular-universal package-lock.json
1个回答
0
投票

如果您仍然遇到这个问题,我使用 pnpm 来解决我的对等依赖问题

更多信息这里

© www.soinside.com 2019 - 2024. All rights reserved.