angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

BrowserslistError: Unknown browser major at error

Open marshallcool opened this issue 8 years ago • 93 comments

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

marshallcool avatar Dec 28 '17 21:12 marshallcool

@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

Matmo10 avatar Feb 09 '18 01:02 Matmo10

@bomberblue07 , @Mathou54 , https://github.com/angular/angular-cli/issues/9557

zhekaus avatar Feb 09 '18 06:02 zhekaus

update to ng cli 1.6.8 in project and global. works with bootstrap 4.0

spelbreker avatar Feb 15 '18 14:02 spelbreker

"bootstrap": "4.0.0-beta.2" is the sauce

kylebradshaw avatar Feb 15 '18 15:02 kylebradshaw

Changed cli version to 1.7.0 in package.json. Working as expected now.

charsi avatar Feb 19 '18 23:02 charsi

@joseph-schenck solution solved my problem

robisonkarls avatar Feb 22 '18 17:02 robisonkarls

Removing the caret ‘^’ of "bootstrap: ^4.0.0-beta.2" solved the problem. Thanks for @oopsmails

JeckyOH avatar Mar 24 '18 21:03 JeckyOH

i have removed following two line from bootstrap/package.json file

"last 1 major version", ">= 1%",

vicanand avatar Mar 28 '18 12:03 vicanand

"bootstrap": "4.0.0-beta.2" worked for me.

sunil237216 avatar Jul 17 '18 11:07 sunil237216

updating bootstrap to 4.1.3 worked for me. I was facing this issue with bootstrap version 4.1.1

andremarcondesteixeira avatar Aug 06 '18 14:08 andremarcondesteixeira

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 avatar Aug 13 '18 20:08 wandersonsc

@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 😲

saiyaff avatar Aug 17 '18 19:08 saiyaff

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.