npm ERR: コード ERESOLVEnpm ERR! ERESOLVE は依存関係ツリー ソリューションを解決できません

今日Angularプロジェクトを作成すると、npmのインストールステップ中にエラーnpm ERRが報告されました

e:\angular\angulardemo>npm install
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/common
npm ERR!   @angular/common@"^14.2.0" from the root project
npm ERR!   peer @angular/common@"14.2.4" from @angular/[email protected]
npm ERR!   node_modules/@angular/forms
npm ERR!     @angular/forms@"^14.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"14.2.3" from @angular/[email protected]
npm ERR! node_modules/@angular/platform-browser
npm ERR!   @angular/platform-browser@"^14.2.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\Administrator\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\Administrator\AppData\Local\npm-cache\_logs\2022-09-29T00_48_00_834Z-debug-0.log

 解決策: 以下に示すように、コマンドの後に --legacy-peer-deps を追加します。

e:\angular\angulardemo>npm install --legacy-peer-deps

added 917 packages in 2m

これで完了です。! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

みんなを助けたい

おすすめ

転載: blog.csdn.net/qq_35262929/article/details/127100431