Browserslist: caniuse-lite is outdated
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!
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
Thank you!
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 hm, strange. Can you show your package.json?
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.
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 yeap, yarn doesn’t have a feature for this case. Here is a issue: https://github.com/yarnpkg/yarn/issues/4986
Solutions:
- Change
yarn.lockmanually. - Call
yarn upgradeto upgrade all dependencies. - Use
yarn --flat
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 answer is the same as above. Use full update npm update
Yes, indeed it helped. Thanks.
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 yeap,
yarndoesn’t have a feature for this case. Here is a issue: yarnpkg/yarn#4986Solutions:
- Change
yarn.lockmanually.- Call
yarn upgradeto upgrade all dependencies.- 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!
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
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.
@Dan503 thank you ,I got resolved this problem!
@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.
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.
after tried so many things i got solved this using npm update command.
I tried yarn upgrade too
@Grawl check npm ls for who load old caniuse-lite