Recently, when I compile my scss files I get an error. The error message says:
Browserslist: caniuse-lite is outdated. Please run next command
n
I did downgrade the node version from 12 to 10
EDIT
This error occurred with me because I was using node version 12. When I downgrade to version 10.16.5 this error stops. This error happened in my local env, but in prod and staging, it not happens. In prod and staging node version is 10.x so I just do this and I didn't need to update any package in my package.json
Many advise you to remove the package-lock.json
or the yarn.lock
. This is clearly a bad idea!
I am using Yarn and I was able to correct this problem by removing only the caniuse-db
and caniuse-lite
entries in my yarn.lock
and doing a yarn
.
It is not necessary to break the main function of the lockfile by deleting it.
delete node_modules/browserslist
directory in the project
now
npm run build
no longer generates that message
If you use yarn:
yarn upgrade
Help for me
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:
C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X
(X is the version of WebCompiler)node_modules
folder: caniuse-lite
and browserslist
Open up CMD (inside C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X
) and run: npm i caniuse-lite browserslist
Try this it solved my problem npx browserslist@latest --update-db