Last updated: Apr 4, 2024
Reading timeยท3 min
To resolve the "Browserslist: caniuse-lite is outdated" issue, open your
terminal in your project's root directory and run the
npx browserslist@latest --update-db
command.
Here is the complete message.
Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Open your terminal in your project's root directory (where your package.json
file is) and run the following command.
npx browserslist@latest --update-db
You will most likely get prompted whether to install browserslist
when you
issue the command.
Type y
and press Enter
to confirm.
The command will:
caniuse-lite
from your
package-lock.json or yarn.lock
file.caniuse-lite
version.caniuse-lite
version.npm update
command if the issue persistsIf the message is still shown when you issue an npm
command, update your
dependencies with the npm update
command.
npm update
The npm update command respects semver. It updates the packages with a fuzzy version to the latest version and installs missing dependencies.
If you use yarn
, use the yarn upgrade
command instead.
yarn upgrade
If the error persists, delete your node_modules
folder and your
package-lock.json
file and reinstall your dependencies.
If you are on macOS or Linux, run the following commands in bash
or zsh
.
# for macOS and Linux rm -rf node_modules rm -f package-lock.json rm -f yarn.lock # ๐๏ธ clean your npm cache npm cache clean --force # ๐๏ธ install packages npm install
If you are on Windows, run the following commands in CMD.
# for Windows rd /s /q "node_modules" del package-lock.json del -f yarn.lock # ๐๏ธ clean your npm cache npm cache clean --force # ๐๏ธ install packages npm install
If you still see the message after reinstalling your modules, update the
browserslist
package.
npx browserslist@latest --update-db
caniuse-lite
package from package-lock.jsonIf you don't want to delete your node_modules
folder and your
package-lock.json
(or yarn.lock
) file, you can:
package-lock.json
or yarn.lock
file.caniuse-lite
package and delete the object.The package will likely be named node_modules/caniuse-lite
.
You can use Ctrl
+ f
(or Cmd
+ f
on macOS) to search for caniuse-lite
.
Make sure to delete the entire object.
npm install
or yarn install
command after you delete the
object.# with NPM npm install # or with YARN yarn install
If you still see the message after reinstalling your modules, update the
browserslist
package.
npx browserslist@latest --update-db
If the issue persists, you can also try to delete the caniuse-lite
and
browserslist
folders from your node_modules
directory and run the following
command.
# with NPM npm install caniuse-lite browserslist # with YARN yarn add caniuse-lite browserslist
If the issue persists, try to update the caniuse-lite and browserslist packages.
# with NPM npm install caniuse-lite@latest browserslist@latest # with YARN yarn add caniuse-lite@latest browserslist@latest
If you use the autoprefixer, make sure to update it as well.
# with NPM npm install autoprefixer@latest # with YARN yarn add autoprefixer@latest
Rerun the following command if the issue persists.
npx browserslist@latest --update-db