Angular全局导入Bootstrap SCSS时提示“Error: Can't find stylesheet to import.”的问题咨询
Angular全局导入Bootstrap SCSS时提示“Error: Can't find stylesheet to import.”的问题咨询
各位好,我在Angular项目里遇到了个棘手的问题,想请教下大家:
我在项目的styles.scss文件里添加了这句导入代码:
@import "bootstrap/scss/bootstrap";
结果直接弹出错误提示:Error: Can't find stylesheet to import.
我的Angular项目结构大致如下:
--src --app --styles.scss --angular.json
另外,angular.json里和样式、脚本相关的配置是这样的:
"styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ], "scripts": ["node_modules/bootstrap/dist/js/bootstrap.min.js"]
我已经尝试过修改@import语句里的路径,试图让它匹配node_modules文件夹里Bootstrap的实际存放位置,但问题还是没解决。有没有朋友知道这到底是哪里出问题了呀?
内容来源于stack exchange
相关产品推荐
相关产品推荐

