BrowserslistError: Unknown browser major at error
I just deleted the node_modules folder and put the packages back
macOs Node 8 node: 8 "@angular/common": "^5.0.0", "@angular/compiler": "^5.0.0", "@angular/compiler-cli": "^5.0.0", "@angular/core": "^5.0.0", "@angular/forms": "^5.0.0", "@angular/http": "^5.0.0", "@angular/cli": "^1.5.0", "@angular/compiler-cli": "^5.0.0",
Error:
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 (/Users/aleksandrgusev/Documents/express_client/node_modules/browserslist/index.js:37:11)
at Function.browserslist.checkName (/Users/aleksandrgusev/Documents/express_client/node_modules/browserslist/index.js:320:18)
at Function.select (/Users/aleksandrgusev/Documents/express_client/node_modules/browserslist/index.js:438:37)
at /Users/aleksandrgusev/Documents/express_client/node_modules/browserslist/index.js:207:41
at Array.forEach (native)
at browserslist (/Users/aleksandrgusev/Documents/express_client/node_modules/browserslist/index.js:196:13)
at Browsers.parse (/Users/aleksandrgusev/Documents/express_client/node_modules/autoprefixer/lib/browsers.js:44:14)
at new Browsers (/Users/aleksandrgusev/Documents/express_client/node_modules/autoprefixer/lib/browsers.js:39:28)
at loadPrefixes (/Users/aleksandrgusev/Documents/express_client/node_modules/autoprefixer/lib/autoprefixer.js:56:18)
at plugin (/Users/aleksandrgusev/Documents/express_client/node_modules/autoprefixer/lib/autoprefixer.js:62:18)
at LazyResult.run (/Users/aleksandrgusev/Documents/express_client/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:270:20)
at LazyResult.asyncTick (/Users/aleksandrgusev/Documents/express_client/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:185:32)
at LazyResult.asyncTick (/Users/aleksandrgusev/Documents/express_client/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:197:22)
at LazyResult.asyncTick (/Users/aleksandrgusev/Documents/express_client/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:197:22)
at processing.Promise.then._this2.processed (/Users/aleksandrgusev/Documents/express_client/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:224:20)
at LazyResult.async (/Users/aleksandrgusev/Documents/express_client/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 ./src/styles.scss ./src/select.css ./node_modules/bootstrap/dist/css/bootstrap.min.css ./node_modules/font-awesome/css/font-awesome.min.css ./node_modules/primeng/resources/primeng.min.css ./node_modules/primeng/resources/themes/omega/theme.css ./node_modules/material-design-icons/iconfont/material-icons.css
@bomberblue07 Same for me. 1.7.0-beta.1 Seems to solve both issues though.
But there's definitely some font issues in the newer 1.7.x versions.
For example, in my angular-cli.json styles section I might have "./assets/fonts/icon-fonts/icon-fonts.css", and in that css file I might have:
@font-face {
font-family: "My icon fonts";
src:url('./icon-fonts.eot');
src:url('./icon-fonts.eot?#iefix') format('embedded-opentype'),
url('./icon-fonts.woff') format('woff'),
url('./icon-fonts.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
and then the browser has warnings about these woff/tff files being corrupted. I even downloaded them and compared them to the original, and they are in fact different.
I believe the error was introduced in 1.7.0-beta2 or 3. @filipesilva
@bomberblue07 , @Mathou54 , https://github.com/angular/angular-cli/issues/9557
update to ng cli 1.6.8 in project and global. works with bootstrap 4.0
"bootstrap": "4.0.0-beta.2" is the sauce
Changed cli version to 1.7.0 in package.json. Working as expected now.
@joseph-schenck solution solved my problem
Removing the caret ‘^’ of "bootstrap: ^4.0.0-beta.2" solved the problem. Thanks for @oopsmails
i have removed following two line from bootstrap/package.json file
"last 1 major version", ">= 1%",
"bootstrap": "4.0.0-beta.2" worked for me.
updating bootstrap to 4.1.3 worked for me. I was facing this issue with bootstrap version 4.1.1
Ha! that's odd, "node_modules/bootstrap/dist/css/bootstrap.min.css", did the trick.
bootstrap": "^4.1.3", Angular CLI: 6.1.3
@wandersonsc Probably the cli path tracking has changed I guess 🤔
I was facing the same issue with the bootstrap version 4.1.3 and cli v 6.1.4. "node_modules/bootstrap/dist/css/bootstrap.min.css" did really solve it 😲
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.