当我使用--prod时,在bootstrap min文件上出现构建错误

时间:2018-02-28 16:09:49

标签: angular bootstrap-4 angular-cli angular5

当我运行命令

ng build
似乎一切都好。

但是当我跑步时

ng build --prod

我收到以下错误:

ERROR in ./node_modules/bootstrap/dist/css/bootstrap.min.css
Module build failed: BrowserslistError: Unknown browser query `>= 1%`
    at error (/var/www/parseek.admin/front/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:37:11)
    at /var/www/parseek.admin/front/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:222:9
    at Array.forEach (native)
    at browserslist (/var/www/parseek.admin/front/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:196:13)
    at /var/www/parseek.admin/front/node_modules/postcss-merge-rules/dist/index.js:261:51
    at LazyResult.run (/var/www/parseek.admin/front/node_modules/postcss/lib/lazy-result.js:277:20)
    at LazyResult.asyncTick (/var/www/parseek.admin/front/node_modules/postcss/lib/lazy-result.js:192:32)
    at LazyResult.asyncTick (/var/www/parseek.admin/front/node_modules/postcss/lib/lazy-result.js:204:22)
....

我用npm install安装了bootstrap。 bootstrap.min.css有什么问题!?

1 个答案:

答案 0 :(得分:0)

正如@ Z.bagley评论的那样,我通过以下命令升级了angular cli

npm install --save-dev @angular/cli@1.7.0-beta.1

问题解决了。