【发布时间】:2018-08-24 09:40:22
【问题描述】:
我已经使用 Angular CLI 安装了 Bootstrap 4,但在运行应用程序后出现错误。
我已经更新angular.json文件如下:
"styles":
[
"src/styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
]
我已经添加了@import '~bootstrap/dist/css/bootstrap.min.css'; style.css 文件。
但我仍然收到错误:
ERROR in multi ./src/styles.css ../node_modules/bootstrap/dist/css/bootstrap.min.css
Module not found: Error: Can't resolve '/Users/user/Projects/A4/node_modules/bootstrap/dist/css/bootstrap.min.css' in '/Users/user/Projects/A4/demo'
【问题讨论】:
-
试试这个“node_modules/bootstrap/dist/css/bootstrap.min.css”。
-
只需将其从
angular.json中的styles数组中删除即可。您在style.css中添加了bootstrap。无需重复此操作
标签: angular npm angular-ui-bootstrap angular-bootstrap