首页 > 解决方案 > 在 Angular 上安装 ng zorro 的问题

问题描述

我正在尝试为 Angular 项目安装 ng zorro。我按照文档,在我输入的控制台上:

ng add ng-zorro-antd

但我收到此错误:

Package installation failed: npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: clima@0.0.0
npm ERR! Found: jasmine-core@3.6.0
npm ERR! node_modules/jasmine-core
npm ERR!   dev jasmine-core@"~3.6.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR!   dev karma-jasmine-html-reporter@"^1.5.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\------\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

我知道这是一个依赖错误,但我不确定它为什么会发生。

谢谢。

编辑:这是我的 Angular 版本

 ng v 

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.2.6
Node: 15.13.0
OS: win32 x64

Angular: <error>
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.6 (cli-only)
@angular-devkit/build-angular   <error>
@angular-devkit/core            11.2.6 (cli-only)
@angular-devkit/schematics      11.2.6 (cli-only)
@angular/cli                    11.2.6 (cli-only)
@schematics/angular             11.2.6 (cli-only)
@schematics/update              0.1102.6 (cli-only)
rxjs                            6.6.3 (cli-only)
typescript                      4.2.4 (cli-only)

标签: angularng-zorro-antd

解决方案


推荐阅读