简体   繁体   English

如何解决以 1 个错误退出的命令“yarn run build”!?

[英]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.

相关问题 Vercel 部署错误:命令“yarn run build”以 1 退出 - Vercel Deployment Error: Command "yarn run build" exited with 1 命令“yarn run build”以 1 退出。Vercel 部署 - Command "yarn run build" exited with 1. Vercel deploy Vercel 部署错误:命令“npm run build”以 1 退出 - Vercel Deployment Error: Command "npm run build" exited with 1 React 和 Vercel:错误:命令“npm run build”以 1 退出? - React and Vercel: Error: Command “npm run build” exited with 1? 错误:命令“npm run build”以 1 退出。vercel 部署错误与 next.js - Error: Command "npm run build" exited with 1. vercel deploy error with next.js 命令 yarn run build 抛出错误 - the command yarn run build throw errors 运行'yarn start'时如何解决这个错误? - How to solve this error when running 'yarn start'? 使用 Github 发布 React+dotnet 核心应用程序引发错误 MSB3073 的操作:命令“npm run build”退出,代码为 1 - Publishing React+dotnet core application using Github Actions throwing error MSB3073: The command “npm run build” exited with code 1 纱线构建不工作,构建失败,因为进程退出过早 - Yarn Build not working, The build failed because the process exited too early 无法运行“纱线运行构建” - unable to run 'yarn run build'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM