Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browserslist: caniuse-lite is outdated #1184

Closed
PostMidnight opened this issue Jan 23, 2019 · 76 comments
Closed

Browserslist: caniuse-lite is outdated #1184

PostMidnight opened this issue Jan 23, 2019 · 76 comments

Comments

@PostMidnight
Copy link

Hello,

First of all, thank you for this awesome library!!!
We are using nodebb which depends on autoprefixer. During nodebb build we noted the following:
Browserslist: caniuse-lite is outdated. Please run next command npm update caniuse-lite browserslist

I believe this is related to autoprefixer dependency that may need updating.
Related issue reported in nodebb github page): NodeBB/NodeBB#7271

Thank you!

@ai
Copy link
Member

ai commented Jan 23, 2019

Hi. Just update the library as it mentioned in the text. Autoprefixer doesn't need any update since it always use latest version.


SOLUTION UPDATE (2020)

npx browserslist@latest --update-db

@ai ai closed this as completed Jan 23, 2019
@PostMidnight
Copy link
Author

Thank you!

@sybrendotinga
Copy link

Sorry to intrude in this topic, but I am having the same issue. I ran the command (yarn upgrade caniuse-lite browserlist), but I keep getting the Browserslist: caniuse-lite is outdated.-message. Do I need to handle it differently for yarn? Or am I doing something wrong?

In my case I am using the postcss-loader which requires postcss, that requires autoprefixer which requires caniuse-lite as a dependency.

I hope you can help @ai or @PostMidnight

@ai
Copy link
Member

ai commented Jan 31, 2019

@sybrendotinga hm, strange. Can you show your package.json?

@sybrendotinga
Copy link

sybrendotinga commented Jan 31, 2019

It is a big one, so I left all the clutter (name, description, etc.) out:

{
  "devDependencies": {
    "@babel/core": "^7.2.2",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/plugin-transform-runtime": "^7.2.0",
    "@babel/polyfill": "^7.2.5",
    "@babel/preset-env": "^7.3.1",
    "@babel/runtime": "^7.3.1",
    "@fortawesome/fontawesome-free": "^5.7.0",
    "@intervolga/optimize-cssnano-plugin": "^1.0.6",
    "@vue/test-utils": "^1.0.0-beta.27",
    "axios": "^0.18.0",
    "babel-core": "^7.0.0-0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.6.0",
    "babel-loader": "^8.0.5",
    "babel-plugin-component": "^1.1.1",
    "browser-sync": "^2.26.3",
    "browser-sync-spa": "^1.0.3",
    "browser-sync-webpack-plugin": "^2.2.2",
    "clean-webpack-plugin": "^1.0.1",
    "css-loader": "^2.1.0",
    "cypress": "^3.1.5",
    "dotenv": "^6.2.0",
    "dotenv-webpack": "^1.7.0",
    "element-theme-chalk": "^2.5.3",
    "element-ui": "^2.5.3",
    "eslint": "^5.12.1",
    "eslint-config-standard": "^12.0.0",
    "eslint-friendly-formatter": "^4.0.1",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-cypress": "^2.2.0",
    "eslint-plugin-import": "^2.16.0",
    "eslint-plugin-node": "^8.0.1",
    "eslint-plugin-promise": "^4.0.1",
    "eslint-plugin-standard": "^4.0.0",
    "eslint-plugin-strict-vue": "^1.0.0",
    "eslint-plugin-vue": "^5.1.0",
    "eslint-plugin-vue-types": "^1.0.0",
    "file-loader": "^3.0.1",
    "friendly-errors-webpack-plugin": "^1.7.0",
    "html-webpack-plugin": "^3.2.0",
    "iotacss": "^1.6.0",
    "jest": "^23.6.0",
    "jest-serializer-vue": "^2.0.2",
    "launch-editor-middleware": "^2.2.1",
    "mini-css-extract-plugin": "^0.5.0",
    "node-ip": "^0.1.2",
    "node-sass": "^4.11.0",
    "postcss-loader": "^3.0.0",
    "regenerator-runtime": "^0.13.1",
    "sass-loader": "^7.1.0",
    "sass-resources-loader": "^2.0.0",
    "static-server": "^2.2.1",
    "style-loader": "^0.23.1",
    "stylelint": "^9.10.1",
    "stylelint-config-recommended": "^2.1.0",
    "stylelint-config-recommended-scss": "^3.2.0",
    "stylelint-config-sass-guidelines": "^5.3.0",
    "stylelint-config-standard": "^18.2.0",
    "stylelint-scss": "^3.5.1",
    "stylelint-webpack-plugin": "^0.10.5",
    "terser-webpack-plugin": "^1.2.1",
    "url-loader": "^1.1.2",
    "vue": "^2.5.22",
    "vue-hot-reload-api": "^2.3.1",
    "vue-html-loader": "^1.0.0",
    "vue-jest": "^3.0.2",
    "vue-loader": "^15.6.2",
    "vue-style-loader": "^4.1.2",
    "vue-template-compiler": "^2.5.22",
    "vue-template-loader": "^1.0.0",
    "vue-types": "^1.3.4",
    "vuelidate": "^0.7.4",
    "vuex": "^3.1.0",
    "webpack": "^4.29.0",
    "webpack-assets-manifest": "^3.1.1",
    "webpack-bundle-analyzer": "^3.0.3",
    "webpack-cleanup-plugin": "^0.5.1",
    "webpack-cli": "^3.2.1",
    "webpack-dev-server": "^3.1.14",
    "webpack-merge": "^4.2.1",
    "webpackbar": "^3.1.5"
  }
}

What I have also tried is to trash the node_modules, and re-run the yarn install. But that had no luck.

@sybrendotinga
Copy link

Maybe you this yarn.local is also interesthing: https://pastebin.com/Szab85NW
I see autoprefixer is not only used by postcss, but also by stylelint.

@ai
Copy link
Member

ai commented Jan 31, 2019

@sybrendotinga yeap, yarn doesn’t have a feature for this case. Here is a issue: yarnpkg/yarn#4986

Solutions:

  1. Change yarn.lock manually.
  2. Call yarn upgrade to upgrade all dependencies.
  3. Use yarn --flat

@ai ai reopened this Jan 31, 2019
@or-else
Copy link

or-else commented Feb 1, 2019

Same issue here. Running npm update caniuse-lite browserslist does not help.

$ cat package-lock.json | grep caniuse
            "caniuse-lite": "^1.0.30000898",
        "caniuse-lite": {
          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000898.tgz",
        "caniuse-lite": "^1.0.30000929",
        "caniuse-lite": {
          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000932.tgz",
    "caniuse-api": {
      "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz",
        "caniuse-lite": "^1.0.0",
            "caniuse-lite": "^1.0.30000876",
            "caniuse-lite": {
              "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000876.tgz",
    "caniuse-lite": {
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000874.tgz",
            "caniuse-lite": "^1.0.30000876",
        "caniuse-lite": {
          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000876.tgz",
        "caniuse-api": "^3.0.0",
            "caniuse-lite": "^1.0.30000876",
        "caniuse-lite": {
          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000876.tgz",
        "caniuse-api": "^3.0.0",
            "caniuse-lite": "^1.0.30000876",
        "caniuse-lite": {
          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000876.tgz",
            "caniuse-lite": "^1.0.30000876",
        "caniuse-lite": {
          "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000876.tgz",
$ cat package.json 
{
  "name": "tinode-webapp",
  "description": "Tinode messenger for the web",
  "version": "0.15.12",
  "devDependencies": {
    "@babel/core": "^7.1.2",
    "@babel/preset-env": "^7.1.0",
    "@babel/preset-react": "^7.0.0",
    "babel-loader": "^8.0.4",
    "babel-plugin-react-intl": "^3.0.1",
    "browserslist": "^4.4.1",
    "cssnano": "^4.0.5",
    "webpack": "^4.23.1",
    "webpack-cli": "^3.1.2"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/tinode/example-react-js.git"
  },
  "scripts": {
    "build": "npm run vers && npm run build:prod && npm run build:dev && npm run build:css && npm run build:i18n",
    "build:css": "postcss css/base.css > css/base.min.css",
    "build:dev": "webpack --mode development --output ./umd/index.dev.js",
    "build:prod": "webpack --mode production --output ./umd/index.prod.js",
    "build:i18n": "node scripts/flatten-messages.js",
    "vers": "node scripts/gen-version.js"
  },
  "files": [
    "src/index.js",
    "src/config.js",
    "src/views/*.jsx",
    "src/widgets/*.jsx",
    "src/lib/*.js",
    "src/i18n/*.json",
    "umd/index.prod.js",
    "umd/index.prod.js.map",
    "umd/index.dev.js",
    "umd/index.dev.js.map",
    "audio/msg.mp3",
    "css/base.css",
    "css/base.min.css",
    "img/ignasi_pattern_s.png",
    "img/logo.svg",
    "img/logo32x32.png",
    "img/logo32x32a.png",
    "img/logo96.png",
    "img/logo192.png",
    "img/badge96.png",
    "img/broken_image.png",
    "index-dev.html",
    "index.html",
    "manifest.json",
    "service-worker.js",
    "firebase-init.js",
    "web-desktop-2.png",
    "web-mob-chat-1.png",
    "web-mob-contacts-1.png",
    "web-mob-info-1.png",
    "web-mob-new-chat-1.png"
  ],
  "keywords": [
    "chat",
    "instant-messenger",
    "message",
    "messenger",
    "react",
    "web"
  ],
  "main": "umd/index.prod.js",
  "bugs": {
    "url": "https://github.com/tinode/example-react-js/issues"
  },
  "homepage": "https://github.com/tinode/chat",
  "email": "info@tinode.co",
  "author": "Tinode Authors <info@tinode.co>",
  "license": "Apache-2.0",
  "dependencies": {
    "firebase": "^5.8.1",
    "react": "^16.6.3",
    "react-dom": "^16.6.3",
    "react-intl": "^2.8.0",
    "tinode-sdk": "^0.15.12"
  }
}

@ai
Copy link
Member

ai commented Feb 1, 2019

@or-else answer is the same as above. Use full update npm update

@or-else
Copy link

or-else commented Feb 1, 2019

Yes, indeed it helped. Thanks.

@Dan503
Copy link
Contributor

Dan503 commented Feb 1, 2019

If you have a multitude of out of date packages, the fastest way to update them is with npm-update-all.

npm i npm-update-all -g
npm-update-all

@sybrendotinga
Copy link

@sybrendotinga yeap, yarn doesn’t have a feature for this case. Here is a issue: yarnpkg/yarn#4986

Solutions:

  1. Change yarn.lock manually.
  2. Call yarn upgrade to upgrade all dependencies.
  3. Use yarn --flat

For me the second option (yarn upgrade) worked.

I noticed that the third action required a lot of manual version picking. I would not recommend going through this process.

The first option probably also requires to run the yarn install command after manually changing the yarn.lock.

Thanks for helping!

@rever96
Copy link

rever96 commented Feb 5, 2019

I have the same problem, npm update caniuse-lite browserslist doesn't help.
Running npm update locks my node-modules folder, I had to delete the folder and reimport it because i had no permission after the update

@inthegarage
Copy link

For me this was caused by slightly out of date ng-packagr/build-ng-packagr. For an angular project, updating them both solved the issue. ng-packagr uses autoprefixer.

@xieyezi
Copy link

xieyezi commented May 2, 2019

@Dan503 thank you ,I got resolved this problem!

@ai ai closed this as completed May 2, 2019
@Dan503
Copy link
Contributor

Dan503 commented May 2, 2019

@sybrendotinga

In my case I am using the postcss-loader which requires postcss, that requires autoprefixer which requires caniuse-lite as a dependency.

npm will use whatever the oldest common dependency is of packages. This is why trying to install the latest version of a package doesn't always install the latest version of the package. An outdated module that also depends on it can hold back the upgrade.

Sometimes you can figure out all the dependency conflicts by searching package-lock.json (Or the yarn equivalent). It can be difficult though.

That is why the easiest way to fix node_modules version conflicts is by using npm-update-all. It is a bit of a nuclear solution but it tends to fix far more problems than it can potentially cause.

@Grawl
Copy link
Contributor

Grawl commented May 23, 2019

I just tried to yarn upgrade caniuse-lite browserslist but with no effect.

Then, I tried to yarn add caniuse-lite browserslist. No effect too.

Still see this warning.

@iamrashed01
Copy link

after tried so many things i got solved this using npm update command.

@Grawl
Copy link
Contributor

Grawl commented May 24, 2019

I tried yarn upgrade too

@ai
Copy link
Member

ai commented May 24, 2019

@Grawl check npm ls for who load old caniuse-lite

@iamrashed01
Copy link

i noticed in my case it's happened for npm install failed, and then i successfully installed npm, still, it shows me but after some time everything works fine.

@Grawl
Copy link
Contributor

Grawl commented May 27, 2019

@ai it's webpack-encore or babel-preset-env

➜ yarn why caniuse-lite                 
yarn why v1.16.0
[1/4] 🤔  Why do we have the module "caniuse-lite"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "caniuse-lite@1.0.30000912"
info Has been hoisted to "caniuse-lite"
info Reasons this module exists
   - "workspace-aggregator-823e49fe-4244-49c9-bc2f-319f96ae3910" depends on it
   - Hoisted from "_project_#my-postcss-config#autoprefixer#caniuse-lite"
   - Hoisted from "_project_#my-postcss-config#autoprefixer#browserslist#caniuse-lite"
info Disk size without dependencies: "3.08MB"
info Disk size with unique dependencies: "3.08MB"
info Disk size with transitive dependencies: "3.08MB"
info Number of shared dependencies: 0
=> Found "babel-preset-env#caniuse-lite@1.0.30000885"
info Reasons this module exists
   - "_project_#my-webpack-encore-config#babel-preset-env#browserslist" depends on it
   - Hoisted from "_project_#my-webpack-encore-config#babel-preset-env#browserslist#caniuse-lite"
info Disk size without dependencies: "3.05MB"
info Disk size with unique dependencies: "3.05MB"
info Disk size with transitive dependencies: "3.05MB"
info Number of shared dependencies: 0
✨  Done in 0.73s.

I though if I run yarn upgrade on project with dependency it must update minor/patch version of required dependency and save it to yarn.lock in project instead of using version from dependency, or it works other way?

@ai
Copy link
Member

ai commented May 28, 2019

I though if I run yarn upgrade on project with dependency it must update minor/patch version of required dependency and save it to yarn.lock

Yeap, it should do it.

Sorry, I have no idea why it doesn’t work. Can you ask yarn community?

@yuanhjty
Copy link

yuanhjty commented Mar 1, 2020

I solved it by the following steps in my project:

  1. removedependencies["caniusep-lite"] in package-lock.json
{
  "dependencies": {
   ...,
    - "caniuse-lite": {
    -   "version": "1.0.30000923",
    -   "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000923.tgz",
    -   "integrity": "sha512-j5ur7eeluOFjjPUkydtXP4KFAsmH3XaQNch5tvWSO+dLHYt5PE+VgJZLWtbVOodfWij6m6zas28T4gB/cLYq1w=="
    - },
    ...
  }
}
  1. npm cache clean --force
  2. remove project node_modules
  3. npm install

@Vanguard90
Copy link

For any lost soul ending up here: My project uses autoprefixer as well. I've updated autoprefixer and that did not solve my problem. I tried many solutions posted here as well with no success.

The culprit was not autoprefixer. It was @babel/preset-env dependency. Updating it to 7.8.7 fixed this problem.

@ai
Copy link
Member

ai commented Mar 17, 2020

Soon we will have special tool npx browserslist --update-db to update caniuse-lite is nested dependencies
browserslist/browserslist#450

@postcss postcss deleted a comment from ucarmurat Mar 18, 2020
@ai
Copy link
Member

ai commented Mar 18, 2020

@ucarmurat I removed your comment, because “use old versions to not see the warning” is a very bad practice.

Warning helps you. The problem is not a warning, but an outdated database. By hiding warning you keep the origin problem in the place.

It is like to stop seeing the doctor to stop listen to sad news rather than start the treatment.

@ai
Copy link
Member

ai commented Mar 19, 2020

Browserslist 4.10 was released with --update-db option.

To hide warning:

  1. Update Bowserslist
  2. Call npx browserslist --update-db

@CodeBradley
Copy link

This is what I get trying to run npx browserslist --update-db

λ npx browserslist --update-db
openssl config failed: error:02001003:system library:fopen:No such process
browserslist: Unknown arguments --update-db.

Usage:
  browserslist
  browserslist "QUERIES"
  browserslist --json "QUERIES"
  browserslist --config="path/to/browserlist/file"
  browserslist --coverage "QUERIES"
  browserslist --coverage=US "QUERIES"
  browserslist --coverage=US,RU,global "QUERIES"
  browserslist --env="environment name defined in config"
  browserslist --stats="path/to/browserlist/stats/file"

@ai
Copy link
Member

ai commented Mar 23, 2020

@CodeBradley seems like you have old Browserslist. Try npx browserslist@4.10 --update-db

@magnusottosson
Copy link

@CodeBradley seems like you have old Browserslist. Try npx browserslist@4.10 --update-db

Thanks, this solved the issue for me.

@cyayung
Copy link

cyayung commented Apr 12, 2020

None of the solutions here worked for me. :(

  • npm update caniuse-lite browserslist
  • npm update caniuse-lite
  • npm update browserslist
  • npm install caniuse-lite -g
  • npm install browserslist -g
  • npm update
  • npm-update-all
  • npm update --depth 10 caniuse-lite browserslist
  • npm update --depth 10 caniuse-lite
  • npm update --depth 10 browserlist
  • all variations with sudo
  • deleting node_modules/ around all variations of these and reinstalling
  • deleting package-lock.json
  • setting specific resolution versions

I appreciate all the answers, hope this annoying warning will go away. I keep thinking something is actually wrong...

lol same

@ai
Copy link
Member

ai commented Apr 12, 2020

@cyayung here is the right solution )you mentioned old solutions)

npx browserslist@latest --update-db

@ai
Copy link
Member

ai commented Apr 15, 2020

@zdimaz try

npx browserslist@latest --update-db

If it will not work, create an issue


I remove your comment because of “noob” word. You will be blocked next time. It is not polite behavior.

@postcss postcss deleted a comment from zdimaz Apr 15, 2020
@postcss postcss deleted a comment from jAbusama Apr 16, 2020
@zdimaz
Copy link

zdimaz commented Apr 16, 2020

C:\Users\Admin>npx browserslist@latest --update-db
npx: installed 11 in 10.301s
Cannot find package.json. Is it a right project to run npx browserslist --update-db?

Does not work autoprefixer

@cyayung
Copy link

cyayung commented Apr 16, 2020

@cyayung here is the right solution )you mentioned old solutions)

npx browserslist@latest --update-db

Thanks for the reply. caniuse-lite is still outdated

@ai
Copy link
Member

ai commented Apr 16, 2020

@zdimaz solution is in the root message. You need to run it in the project.

@ai
Copy link
Member

ai commented Apr 16, 2020

@cyayung create an issue at Browserslist with all details

@aaronjensen
Copy link

Seeing the same:

❯ npx browserslist@latest --update-db

npx: installed 11 in 2.333s
Current version: 1.0.30001048
New version: 1.0.30001048
Updating caniuse-lite…
caniuse-lite has been successfully updated% 

@ai
Copy link
Member

ai commented Apr 27, 2020

@aaronjensen yeap, you already have the latest caniuse-lite.

If you still have a warning, please open a issue with your npm ls output.

@markgogo
Copy link

markgogo commented May 7, 2020

If you have a multitude of out of date packages, the fastest way to update them is with npm-update-all.

npm i npm-update-all -g
npm-update-all

after this update command, high chance the project will no longer build...then need to find ways to roll back..... don't ask me how I know....

caasi added a commit to caasi/caasih.net that referenced this issue May 7, 2020
joelmichael added a commit to fosterful/scheduler that referenced this issue May 22, 2020
Apparently can't use yarn for this.
Gets rid of caniuse-lite deprecation warning when running bin/webpack.
postcss/autoprefixer#1184
Kamigami55 added a commit to CAMPUS-NYCU/SmartCampus that referenced this issue May 22, 2020
方法:
執行`npx browserslist@latest --update-db`

ref:
postcss/autoprefixer#1184 (comment)
@postcss postcss deleted a comment from inwardmovement Jun 10, 2020
@ai
Copy link
Member

ai commented Jun 10, 2020

The official solution for caniuse-lite is outdated is:

npx browserslist@latest --update-db

@postcss postcss locked as resolved and limited conversation to collaborators Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests