使用 Jenkins 进行 React 构建 - 错误:“build-js”退出时为 1
我目前正在将本地 Jenkins 迁移到新的 EC2 实例,并在传输 UI 构建管道时,在构建过程中遇到以下错误:
错误:“build-js”以 1 退出。
I之前在当前的 Jenkins 服务器上收到过此问题,但是,通过执行以下操作解决了这个问题:
react-app-rewired --max_old_space_size=4096 build
服务器/构建详细信息:
t3.large - 2 vCPU and 8gb Ram
Amazon Linux - 64bit x86
Node 16.14.0
我尝试了多个选项然而,他们似乎都不想工作。 max-old-space 似乎什么也没做。甚至不确定还有哪些其他选项可用。
I'm currently migrating my local Jenkins to a new EC2 instance and in transferring the UI build pipeline, I currently am getting the following error during build:
ERROR: "build-js" exited with 1.
I had received this previously on the current Jenkins server, however, it was resolved by doing the following:
react-app-rewired --max_old_space_size=4096 build
Server / build details:
t3.large - 2 vCPU and 8gb Ram
Amazon Linux - 64bit x86
Node 16.14.0
I have tried multiple options with the build, however, none of them appear to want to work. The max-old-space doesn't even seem to be doing anything. Not even sure what other options are available.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将 CI 标志设置为 false 来构建您的 React 应用程序
如果这不起作用,则尝试直接更改标志
*react-scripts 需要根据您使用的内容进行替换
Try to build your react app with CI flag set to false
If this doesnt work then try directly change the flag
*react-scripts needs to be replaced depending on wht you use
--max_old_space_size
指示您的构建过程可以使用多少内存,尝试将其调大:react-app-rewired --max_old_space_size=8192 版本
The
--max_old_space_size
indicate how much memory your build process can use, try make it bigger:react-app-rewired --max_old_space_size=8192 build