【发布时间】:2020-01-24 22:31:54
【问题描述】:
我一直在尝试构建我之前构建良好的代码的生产版本。现在,当我在 main.js 文件上运行 vue build 时,它提供了以下内容:
\ Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
\ Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
\ Building for production...Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
(node:10708) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: CSS minification error: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.. File: css/app.75eb53b0.css
(node:10708) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
我已尝试通过手动更新包和依赖于它的包、启动新项目、运行npm --depth 999 命令(深度 9999 导致内存堆错误)来解决 Browserslist/caniuse-lite 错误,以及我能找到的所有其他事情。我没有使用 VS(使用 VS 代码),但试图通过从我的 AppData 中删除 WebCompiler 信息来解决问题,但没有 WebCompiler 文件夹开始。
我还尝试恢复到 css-loader 2.1.1,这解决了在处理此问题时出现的另一个问题,但尚未解决此问题。
任何帮助将不胜感激,因为这会阻止任何更新发布到生产。
我已尝试在其他线程中修复有关 Browserslist 警告的问题。此外,这些线程没有提到以下错误:
(node:10708) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: CSS minification error: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.. File: css/app.75eb53b0.css
(node:10708) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
以下是我的项目的 package.json
{
"name": "coeus",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.25",
"@fortawesome/free-brands-svg-icons": "^5.11.2",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/vue-fontawesome": "^0.1.7",
"axios": "^0.19.0",
"bcrypt": "^3.0.6",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"bootstrap-vue": "^2.0.2",
"browserslist": "^4.7.0",
"caniuse-lite": "^1.0.30000997",
"cors": "^2.8.5",
"dns": "^0.2.2",
"express": "^4.17.1",
"express-fileupload": "^1.1.5",
"fast-csv": "^3.4.0",
"json-loader": "^0.5.7",
"jsonwebtoken": "^8.5.1",
"method-override": "^3.0.0",
"mongoose": "^5.7.1",
"morgan": "^1.9.1",
"nodemailer": "^6.3.0",
"npm": "^6.11.3",
"path": "^0.12.7",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-service": "^3.11.0",
"@vue/eslint-config-prettier": "^5.0.0",
"css-loader": "^2.1.1",
"style-loader": "^1.0.0",
"vue-template-compiler": "^2.6.10"
}
}
【问题讨论】:
-
你正在寻找这个*.com/questions/55271798/…
-
谢谢,但是“C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X”对我来说不存在
-
可能,虽然我已经尝试了该线程中的所有修复,但它没有提到
(node:10708) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: CSS minification error: Unknown browser querybasedir=$(dirname "$(echo "$0" | sed -e 's@ 987654329@ -
请出示您的 JSON 代码
标签: vue.js npm vue-cli vue-cli-3