gpt4 book ai didi

vue.js - 如何为我的 Vue 构建修复 'Browserslist: caniuse-lite is outdated'?

转载 作者:搜寻专家 更新时间:2023-10-30 22:11:42 25 4
gpt4 key购买 nike

通过 npm 进行 vue-cli 构建时出现此错误:

Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`

这直到最近才有效,我不确定什么会导致它开始失败。似乎是某个时间范围命中导致它开始报告为“过时”,但我不知道要更新什么来修复它。

我试过运行建议的命令,但没有成功。我通过 npm 执行此操作并且没有使用 Visual Studio,所以我没有使用 WebCompiler(并且该目录不存在于我的用户文件夹中)因此 Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist` 中的解决方案不适用。

这也发生在我们通过 VSO 运行的构建系统上,所以它不仅仅是我的盒子。

这是我的 package.json 文件:

{
"name": "productName.portal",
"version": "1.0.0",
"description": "productName.portal static content",
"main": "gulpfile.js",
"keywords": [
"gulp",
"task"
],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"@types/jest": "^23.1.4",
"@types/jquery": "^3.3.4",
"@types/underscore": "^1.8.8",
"@voerro/vue-tagsinput": "^1.8.0",
"@vue/cli-plugin-babel": "^3.0.0-rc.4",
"@vue/cli-plugin-typescript": "^3.0.0-rc.4",
"@vue/cli-plugin-unit-jest": "^3.0.1",
"@vue/cli-service": "3.0.0-rc.4",
"@vue/test-utils": "^1.0.0-beta.20",
"axios": "^0.18.0",
"babel-core": "7.0.0-bridge.0",
"babel-polyfill": "^6.26.0",
"copy-webpack-plugin": "^4.5.2",
"gulp": "^3.9.0",
"gulp-clean-css": "latest",
"gulp-concat": "latest",
"gulp-sourcemaps": "latest",
"gulp-uglify": "latest",
"jquery": "^3.3.1",
"moment": "^2.22.2",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"script-loader": "^0.7.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"ts-jest": "^23.0.0",
"underscore": "^1.9.1",
"vue-i18n": "^8.0.0",
"vue-js-modal": "^1.3.16",
"vue-loading-overlay": "^2.1.0",
"vue-simple-spinner": "^1.2.8",
"vue-template-compiler": "^2.5.16",
"vue-toasted": "^1.1.24",
"vuejs-datepicker": "^1.5.2"
},
"dependencies": {
"node": "^9.9.0",
"typescript": "^3.0.1",
"trie-search": "^1.2.8",
"vue": "^2.5.16",
"vue-class-component": "^6.0.0",
"vue-property-decorator": "^7.0.0",
"vuex": "^3.0.1"
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"unittest": "vue-cli-service test:unit"
}
}

最佳答案

这完全取决于 @babel/preset-env 的依赖项

├─┬ @babel/preset-env
│ ├─┬ browserslist
│ │ ├── caniuse-lite

你可以通过更新那个包来纠正这个问题

npm update @babel/preset-env

刚刚意识到 Vue 使用了更多的依赖级别

├─┬ @vue/cli-plugin-babel
│ ├─┬ @vue/babel-preset-app
│ │ ├─┬ @babel/preset-env

所以你需要更新 @vue/cli-plugin-babel 包。

关于vue.js - 如何为我的 Vue 构建修复 'Browserslist: caniuse-lite is outdated'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55408329/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com