Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BrowserslistError: Unknown browser major

I'm trying to use bootstrap 4 with my angular installation. i've run npm install --save bootstrap@next but i have a break at runtime :

./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null,null],"sourceMap":false}!./node_modules/bootstrap/dist/css/bootstrap.min.css
Module build failed: BrowserslistError: Unknown browser major
    at error (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:37:11)
    at Function.browserslist.checkName (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:320:18)
    at Function.select (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:438:37)
    at C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:207:41
    at Array.forEach (native)
    at browserslist (C:\xampp\htdocs\tick_master_angular\web\node_modules\browserslist\index.js:196:13)
    at Browsers.parse (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\browsers.js:44:14)
    at new Browsers (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\browsers.js:39:28)
    at loadPrefixes (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\autoprefixer.js:56:18)
    at plugin (C:\xampp\htdocs\tick_master_angular\web\node_modules\autoprefixer\lib\autoprefixer.js:62:18)
    at LazyResult.run (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:270:20)
    at LazyResult.asyncTick (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:185:32)
    at LazyResult.asyncTick (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:197:22)
    at processing.Promise.then._this2.processed (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:224:20)
    at LazyResult.async (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:221:27)
    at LazyResult.then (C:\xampp\htdocs\tick_master_angular\web\node_modules\postcss-loader\node_modules\postcss\lib\lazy-result.js:127:21)
 @ ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./src/styles.css 3:10-190
 @ ./src/styles.css
 @ multi ./src/styles.css

Can someone help please?

like image 360
Tiny Skillz Avatar asked Dec 29 '17 02:12

Tiny Skillz


2 Answers

The issue could be that you got the latest build with some bug. I noticed that [email protected] is causing this issue, but not [email protected]. Check if yours is the same. Try uninstalling that and run something with a specific version.

npm install [email protected]

This resolved my problem.

like image 140
Jay Avatar answered Sep 23 '22 10:09

Jay


Bootstrap new version come which is v4.0.0-beta.2 and your package.json has ^bootstrap4.0.0-alpha.6 so new bootstrap version wants browsers list dependency.

To run your app remove lastest version tag (^) & run npm install command

like image 27
Sagar Jadhav Avatar answered Sep 24 '22 10:09

Sagar Jadhav