autoprefixer icon indicating copy to clipboard operation
autoprefixer copied to clipboard

Browserslist: caniuse-lite is outdated

Open PostMidnight opened this issue 7 years ago • 75 comments

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): https://github.com/NodeBB/NodeBB/issues/7271

Thank you!

PostMidnight avatar Jan 23 '19 06:01 PostMidnight

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 avatar Jan 23 '19 09:01 ai

Thank you!

PostMidnight avatar Jan 23 '19 12:01 PostMidnight

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

sybrendotinga avatar Jan 31 '19 13:01 sybrendotinga

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

ai avatar Jan 31 '19 14:01 ai

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 avatar Jan 31 '19 15:01 sybrendotinga

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.

sybrendotinga avatar Jan 31 '19 16:01 sybrendotinga

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

Solutions:

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

ai avatar Jan 31 '19 17:01 ai

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": "[email protected]",
  "author": "Tinode Authors <[email protected]>",
  "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"
  }
}

or-else avatar Feb 01 '19 09:02 or-else

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

ai avatar Feb 01 '19 11:02 ai

Yes, indeed it helped. Thanks.

or-else avatar Feb 01 '19 11:02 or-else

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

Dan503 avatar Feb 01 '19 15:02 Dan503

@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!

sybrendotinga avatar Feb 01 '19 16:02 sybrendotinga

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

rever96 avatar Feb 05 '19 15:02 rever96

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.

inthegarage avatar Apr 16 '19 11:04 inthegarage

@Dan503 thank you ,I got resolved this problem!

xieyezi avatar May 02 '19 11:05 xieyezi

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

Dan503 avatar May 02 '19 14:05 Dan503

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.

Grawl avatar May 23 '19 06:05 Grawl

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

iamrashed01 avatar May 23 '19 07:05 iamrashed01

I tried yarn upgrade too

Grawl avatar May 24 '19 09:05 Grawl

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

ai avatar May 24 '19 09:05 ai