gpt4 book ai didi

angular - npm 没有在 Angular 11 中安装最新版本的 ngx-bootstrap

转载 作者:行者123 更新时间:2023-12-05 06:05:04 27 4
gpt4 key购买 nike

ng 添加 ngx-bootstrap通过 npm 安装工具包。通过 npm 为工具安装包。发生未处理的异常:找不到模块“@schematics/angular/utility/config”需要堆栈:

  • C:\client\node_modules\ngx-bootstrap\schematics\ng-add\index.js
  • C:\client\node_modules@angular-devkit\schematics\tools\export-ref.js
  • C:\client\node_modules@angular-devkit\schematics\tools\index.js
  • C:\client\node_modules@angular\cli\utilities\json-schema.js
  • C:\client\node_modules@angular\cli\models\command-runner.js
  • C:\client\node_modules@angular\cli\lib\cli\index.js
  • C:\Users\Jaswik\AppData\Roaming\npm\node_modules@angular\cli\lib\init.js
  • C:\Users\Jaswik\AppData\Roaming\npm\node_modules@angular\cli\bin\ng有关详细信息,请参阅“C:\Users\Jaswik\AppData\Local\Temp\ng-2BGEbQ\angular-errors.log”。

最佳答案

首先,您需要使用 npm 在您的项目中安装 ngx-bootstrap:

npm install ngx-bootstrap --save

接下来,您需要将此链接添加到您的 HTML 文件

<link  href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"  rel="stylesheet">

您还可以使用 Angular CLI 11 的 ng add 命令通过 simpy 运行以下命令自动将 ngx-bootstrap 添加到您的项目中:-

ng add ngx-bootstrap

这个命令会自动添加必要的文件您也可以使用此命令单独添加 ngx 文件

  ng add ngx-bootstrap  --component accordion
ng add ngx-bootstrap --component alerts
ng add ngx-bootstrap --component buttons
ng add ngx-bootstrap --component carousel
ng add ngx-bootstrap --component collapse
ng add ngx-bootstrap --component datepicker
ng add ngx-bootstrap --component dropdowns
ng add ngx-bootstrap --component modals
ng add ngx-bootstrap --component pagination
ng add ngx-bootstrap --component popover
ng add ngx-bootstrap --component progressbar
ng add ngx-bootstrap --component rating
ng add ngx-bootstrap --component sortable
ng add ngx-bootstrap --component tabs
ng add ngx-bootstrap --component timepicker
ng add ngx-bootstrap --component tooltip
ng add ngx-bootstrap --component typeahead

如果你想安装 bootstrap 然后安装它首先,我们将开始使用安装依赖项

npm install bootstrap --save

接下来,您需要使用以下命令从 npm 安装 ng-bootstrap:-

npm install --save @ng-bootstrap/ng-bootstrap

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

如果您想使用 Angular 11 安装 bootstrap

npm install bootstrap --save

有很多方法可以做到这一点。最简单的方法是使用 src/styles.css 文件并添加以下代码:

@import "~bootstrap/dist/css/bootstrap.css";

如果要安装

关于angular - npm 没有在 Angular 11 中安装最新版本的 ngx-bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66085045/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com