当我尝试在angular4 cli(windows)中安装bootstrap时,会发生以下错误
npm install bootstrap --save
npm WARN可选SKIPPING OPTIONAL DEPENDENCY:fsevents@1.1.3(node_modules \ fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:不支持的fsevents@1.1.3平台:想要{" os":" darwin"," arch":"任何& #34;}(当前:{" os":" win32"," arch":" x64"})
答案 0 :(得分:0)
如果您可以在父bootstrap
文件夹中找到node_modules
文件夹,则知道是否正确安装了引导程序。如果你还没有,我也会尝试这个:
npm install --save bootstrap
将Bootstrap导入
@import "~bootstrap/dist/css/bootstrap.css";
或.angular-cli.json通过styles属性:
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
答案 1 :(得分:0)
使用这些命令对我有用
npm install bootstrap
然后将其包含在angular.json
中"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.js"
]