Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 node_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.

like image 944
Nick Mehrdad Babaki Avatar asked Oct 12 '22 00:10

Nick Mehrdad Babaki


People also ask

What is Browserslist latest -- update DB?

npx update-browserslist-db@latest updates caniuse-lite version in your npm, yarn or pnpm lock file. This update will bring data about new browsers to polyfills tools like Autoprefixer or Babel and reduce already unnecessary polyfills.

What is caniuse-lite used for?

caniuse-lite then, is a smaller dataset that keeps essential parts of the data in a compact format. It does this in multiple ways, such as converting null array entries into empty strings, representing support data as an integer rather than a string, and using base62 references instead of longer human-readable keys.

What is Browserslist in package JSON?

What is Browserslist? Browserslist is a tool that allows specifying which browsers should be supported in your frontend app by specifying "queries" in a config file. It's used by frameworks/libraries such as React, Angular and Vue, but it's not limited to them.


1 Answers

Try this it solved my problem npx browserslist@latest --update-db

like image 172
Dipanker Shah Avatar answered Oct 20 '22 02:10

Dipanker Shah