NodeJS Bootstrap安装已验证,但仍无法加载Angular 13组件

ix0qys7i  于 2023-06-05  发布在  Node.js
关注(0)|答案(1)|浏览(143)

无法将Bootstrap加载到新的Angular 13项目中的一个组件。

  1. angular.json文件已经添加了以下行:
"styles": [
              "src/styles.css",
              "./node_modules/bootstrap/dist/css/bootstrap.min.css"
              ],

1.我验证了我有引导安装在上述位置。
1.我使用下面的node命令安装了bootstrap:npm install bootstrap@3

643ylb08

643ylb081#

你的设置看起来不错。我通常也会安装@ng-bootstrap/bootstrap,以使用引导模式。
documentation提到了这个兼容性表,但这些实际上只是指南。

我一直在使用以下版本的Angular 14.0.6,没有任何问题。所以,我很确定你也可以在Angular 13上使用它们。

"@ng-bootstrap/ng-bootstrap": "^6.2.0",
"bootstrap": "^4.4.1",

正如你提到的,我有angular.json

"styles": [
  "node_modules/bootstrap/dist/css/bootstrap.min.css",
  "src/styles.css"
],

相关问题