Disable caniuse-lite outdated warning for Node project
See original GitHub issueHello - I am using babel
to compile TypeScript code and I’m not even targeting browsers, but I’m still getting a warning that caniuse-lite
is outdated.
Is there some way that I can disable this warning?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
caniuse-lite is outdated. Please run next command `npm ...
Close Visual Studio · Head to C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X (X is the version of WebCompiler) · Delete following folders ...
Read more >ERROR: Browserslist: caniuse-lite is outdated - SonarQube
Hi! Running scan with sonar 8.9 on a project containing css files shows the f…
Read more >Fix static-analysis failure due to caniuse-lite dependency
The problem may be occurring because browserslist is detecting that caniuse-list is approximately 6 months old and outputs a warning using console.warn ......
Read more >Warning from npm - caniuse-lite is outdated - Elixir Forum
I tried running the command, and got no errors, but the warning didn't go away. I also tried mix clean; mix compile ,...
Read more >Browserslist: caniuse-lite is outdated - help - Meteor forums
I get message Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist` But I don't have this ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was also running into this both when targeting Node or when targeting specific old client targets (e.g. IE 10). Glancing at the code, I worked around this by adding
process.env.BROWSERSLIST_IGNORE_OLD_DATA = 1;
before calling into Babel and it suppresses the error. Hope this helps anyone else arriving here.I can confirm that the warning pops up if
targets
is not set and even if@babel/preset-env
are not added!Setting your babel config’s
targets
tonode
fixes the issue, e.g.:Note that the node target requires a concete
semver
.The Problem
This finding implies that Babel now (somehow?) “targets” the browser by default, and (to the best of my knowledge) has not properly documented this behavior. I am not even sure what kind of targeting it does? Maybe it is caused by some plugins?
At the very least, this is a documentation bug:
targets
are only documented for@babel/preset-env
, but are also applied ifpreset-env
is not added. That needs to be fixed, and target behavior withoutpreset-env
should be properly explained.