在角度4中运行构建--prod --base-href时出错

时间:2018-02-07 11:38:59

标签: angular

运行ng build --prod --base-href

时出现以下错误消息
   ./node_modules/bootstrap/dist/css/bootstrap.min.css中的错误       模块构建失败:BrowserslistError:未知的浏览器主要版本           出错(C:\ Users \ Gurpreet_Singh29 \ Practice Work \ SOPID \ SOP \ node_modules \ postcss-merge-rules \ node_modules \ browserslist \ index.js:37:11)           在Function.browserslist.checkName(C:\ Users \ Gurpreet_Singh29 \ Practice   工作\ SOPID \ SOP \ node_modules \ postcss合并规则\ node_modules \ browserslist \ index.js:320:18)           在Function.select(C:\ Users \ Gurpreet_Singh29 \ Practice Work \ SOPID \ SOP \ node_modules \ postcss-merge-rules \ node_modules \ browserslist \ index.js:438:37)           在C:\ Users \ Gurpreet_Singh29 \ Practice Work \ SOPID \ SOP \ node_modules \ postcss-merge-rules \ node_modules \ browserslist \ index.js:207:41           在Array.forEach()           在browserslist(C:\ Users \ Gurpreet_Singh29 \ Practice Work \ SOPID \ SOP \ node_modules \ postcss-merge-rules \ node_modules \ browserslist \ index.js:196:13)           在C:\ Users \ Gurpreet_Singh29 \ Practice Work \ SOPID \ SOP \ node_modules \ postcss-merge-rules \ dist \ index.js:261:51           ...

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

如果您使用npm包含它并更改网址以匹配该版本,请将package.json中的bootstrap版本更改为"bootstrap": "4.0.0-beta.2"

错误与此错误有关..

https://github.com/angular/angular-cli/issues/9020

非生产版本中不应出现错误。