Bootstrap: Module build failed: BrowserslistError: Unknown browser major, 4.0.0-beta.3

Created on 29 Dec 2017  路  5Comments  路  Source: twbs/bootstrap

I just install 4.0.0-beta.3 within my Angular 5 project with npm install [email protected]
In [email protected] I used following .angular-cli.json config and it works well

"styles": [        
  "../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
  "../node_modules/jquery/dist/jquery.min.js",
  "../node_modules/bootstrap/dist/js/bootstrap.bundle.js"
]

But in [email protected] I get the following error at ng serve command

ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/bootstrap/dist/css/bootstrap.min.css
Module build failed: BrowserslistError: Unknown browser major
    at error (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\browserslist\index.js:37:11)
    at Function.browserslist.checkName (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\browserslist\index.js:320:18)
    at Function.select (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\browserslist\index.js:438:37)
    at D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\browserslist\index.js:207:41
    at Array.forEach (<anonymous>)
    at browserslist (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\browserslist\index.js:196:13)
    at Browsers.parse (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\autoprefixer\lib\browsers.js:44:14)
    at new Browsers (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\autoprefixer\lib\browsers.js:39:28)
    at loadPrefixes (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\autoprefixer\lib\autoprefixer.js:56:18)
    at plugin (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\autoprefixer\lib\autoprefixer.js:62:18)
    at LazyResult.run (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:270:20)
    at LazyResult.asyncTick (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:185:32)
    at LazyResult.asyncTick (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:197:22)
    at processing.Promise.then._this2.processed (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:224:20)
    at new Promise (<anonymous>)
    at LazyResult.async (D:\Sources\VistaBest\VistaBest\VistaBest.Angular\VistaBest\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:221:27)
 @ ./node_modules/bootstrap/dist/css/bootstrap.min.css 4:14-131
 @ multi ./node_modules/bootstrap/dist/css/bootstrap.min.css ./src/bootstrap-custom.css ./src/materials-custom.css ./src/styles.css ./src/rtl.css

My jQuery version: 3.2.1
Angular cli version: 1.6.2

Most helpful comment

in Case someone else lands here. This is an angular reported issue see https://github.com/angular/angular-cli/issues/9020

All 5 comments

Bootstrap cannot help with this, you should ask angular folks.
The error is related to browserlist which is used by autoprefixer

Closing per above comment.

in Case someone else lands here. This is an angular reported issue see https://github.com/angular/angular-cli/issues/9020

And will be in the next version of Angular-cli related PR : https://github.com/angular/angular-cli/pull/9023

Just globally update your angular/cli before starting a new project:
npm i -g @angular/cli
It works with beta 3, too !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

tiendq picture tiendq  路  3Comments

alvarotrigo picture alvarotrigo  路  3Comments

ziyi2 picture ziyi2  路  3Comments

athimannil picture athimannil  路  3Comments