ng-packagr: BrowserslistError: Unknown version 67 of android
Type of Issue
[x] Bug Report
[ ] Feature Request
Description
Recently I updated my Angular project dependency versions and I get this error when trying to build a library:
ERROR: Unknown version 67 of android
An unhandled exception occurred: Unknown version 67 of android
See "C:\Users\doteteix\AppData\Local\Temp\ng-5ErChV\angular-errors.log" for further details.
I can get more detail from this angular-errors.log. This is the extra info:
[error] BrowserslistError: Unknown version 67 of android
at Function.select (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\node_modules\browserslist\index.js:924:17)
at C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\node_modules\browserslist\index.js:252:33
at Array.reduce (<anonymous>)
at resolve (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\node_modules\browserslist\index.js:234:18)
at browserslist (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\node_modules\browserslist\index.js:353:16)
at Browsers.parse (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\lib\browsers.js:66:12)
at new Browsers (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\lib\browsers.js:48:26)
at loadPrefixes (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\lib\autoprefixer.js:101:20)
at plugin (C:\Projects\Source\html5-console\node_modules\ng-packagr\node_modules\autoprefixer\lib\autoprefixer.js:112:20)
at LazyResult.run (C:\Projects\Source\html5-console\node_modules\postcss\lib\lazy-result.js:295:14)
How To Reproduce
I try to build my lirary executing:
ng build core
Expected Behaviour
The library is built as expected and as usual before I updated versions.
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 5.5.1
@angular/*: 8.2.5
@angular/cli: ^8.3.3
@angular/material: 8.1.4
@angular/cdk: 8.1.4
typescript: ~3.4.3
rxjs: ^6.4.0
node: 12.8.0
npm: 6.10.2
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Bust yarn.lock to avoid caniuse issue See https://github.com/ng-packagr/ng-packagr/issues/1411 — committed to Ecodev/natural by PowerKiKi 4 years ago
@mrtijn I was able to fix it by taking these steps:
1.Deleting the entire node_modules directory 2.Deleting package-lock.json from the root directory 3. Making sure the latest @angular-devkit projects were referenced in package.json:
"@angular-devkit/build-angular": "^0.801.3", "@angular-devkit/build-ng-packagr": "^0.801.3",That fixes it. Have no idea why.
I have tried @andrewryan1906 solution. I deleted my node_modules and package-lock.json file, re-installed with
"@angular-devkit/build-angular": "^0.801.3"and"@angular-devkit/build-ng-packagr": "^0.801.3"I am still getting:
BUILD ERROR Unknown version 67 of android An unhandled exception occurred: Unknown version 67 of androidSOLUTION UPDATE:
I had to explicitly install the working version of “caniuse-lite” to version “1.0.30000997”
This is still causing PROBLEMS!!!
Compiling TypeScript sources through ngc ERROR: Unknown version 67 of androidI got an
ERROR: Unknown version 80 of edgewhen building publishable library (ng9). It just happens when I import another module in the library. Even the empty module. The module is defined inside the library scope. I don’t understand the error text, how it is connected to a ng-packagr?For the record, I went through this today on a pretty important enterprise monorepo with angular, nrwl, storybook, ng-packagr, and some other such suchery. After merging a PR that ironed out visual regression testing in storybook, I tried to build one of the libs and it failed with this error.
A look at Android showed that v67 of Firefox for Android was released in May. So it would seem anything that browserlist checks Android versions that hasn’t been updated in anticipation of that, or that doesn’t have some kind of “ignore”, will cause this grief.
I ran ng update, looked at what needed updating (went from 8.0.x to I think 8.2.x), followed it carefully (checking ng version etc), and that cleared it. BUT…now I had peer dep warnings. So I went through all those, and eventually cleared them all out. Wipe that package.lock as you go.
The joy of the JS/TS/Angular ecosystem. The upshot: update your versions. This is one of those Apple-like ones; no explanation just upgrade.
@andrewryan1906 mentioned is the correct solution.
Thanks