Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
Recently, when I compile my scss files I get an error. The error message says:
Browserslist: caniuse-lite is outdated. Please run next command
npm update caniuse-lite browserslist
First, as the message says, I ran npm update caniuse-lite browserslist
but it didn't fix the issue.
I deleted the whole nod-modules directory and installed again, also I updated the whole folder by npm update
but none of them solved the issue.
I also reinstalled autoprefixer and browserslist but none of them solved the issue.
If I remove
"options": {
"autoPrefix": "> 1%"
}
from my compilerconfig.json
, everything works fine which means probably it is related to autoprefixer. Also, I manually changed the package version to the latest version on package.json
and reinstalled but no luck.
Solution 1:
Try this it solved my problem npx browserslist@latest --update-db
Solution 2:
It sounds like you are using Visual Studio's Web Compiler extension. There is an open issue for this found here: https://github.com/madskristensen/WebCompiler/issues/413
There is a workaround posted in that issue:
- Close Visual Studio
- Head to
C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X
(X is the version of WebCompiler) - Delete following folders from
node_modules
folder:caniuse-lite
andbrowserslist
Open up CMD (insideC:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X
) and run:npm i caniuse-lite browserslist