[英]How to solve Command "yarn run build" exited with 1 Error!?
I've created my vercel app before, but when I tried to update with vercel --prod
, I got我之前已经创建了我的 vercel 应用程序,但是当我尝试使用
vercel --prod
进行更新时,我得到了
Error! Command "yarn run build" exited with 1
Error! Check your logs...
When I check my logs I got it, but I do not understand what to do with them because I had others empty vars, for example, but it was not a problem.当我检查我的日志时,我得到了它,但我不知道如何处理它们,因为例如我有其他空变量,但这不是问题。
16:02:07.366 Retrieving list of deployment files...
16:02:08.837 Downloading 25 deployment files...
16:02:09.301 Analyzing source code...
16:02:10.840 Installing build runtime...
16:02:13.806 Build runtime installed: 2.965s
16:02:17.056 Looking up build cache...
16:02:19.686 Build cache downloaded [24.72 MB]: 2226.563ms
16:02:20.981 Detected package.json
16:02:20.982 Installing dependencies...
16:02:21.305 yarn install v1.22.17
16:02:21.420 [1/4] Resolving packages...
16:02:22.236 success Already up-to-date.
16:02:22.241 Done in 0.94s.
16:02:22.515 Running "yarn run build"
16:02:22.752 yarn run v1.22.17
16:02:22.793 $ react-scripts build
16:02:24.503 Creating an optimized production build...
16:02:25.419 Browserslist: caniuse-lite is outdated. Please run:
16:02:25.419 npx browserslist@latest --update-db
16:02:25.420
16:02:25.420 Why you should do it regularly:
16:02:25.420 https://github.com/browserslist/browserslist#browsers-data-updating
16:02:29.686
16:02:29.686 Treating warnings as errors because process.env.CI = true.
16:02:29.687 Most CI servers set it automatically.
16:02:29.687
16:02:29.687 Failed to compile.
16:02:29.687
16:02:29.688 src/App.js
16:02:29.688 Line 7:20: 'setProducts' is assigned a value but never used no-unused-vars
16:02:29.688
16:02:29.688 src/components/CartProduct/index.jsx
16:02:29.688 Line 7:17: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
16:02:29.688
16:02:29.689 src/components/Product/index.jsx
16:02:29.691 Line 7:13: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
16:02:29.691
16:02:29.691
16:02:29.714 error Command failed with exit code 1.
16:02:29.714 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
16:02:29.732 Error: Command "yarn run build" exited with 1
In your eslint config file, turn off no-unused-var在你的 eslint 配置文件中,关闭no-unused-var
"rules": {
.....
"no-unused-vars": "off"
.....
}
and add Alt for your images tags with or without text:并为带有或不带有文本的图像标签添加 Alt:
<img src="[image url]" alt="" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.