使用 Jenkins 进行 React 构建 - 错误:“build-js”退出时为 1

发布于 2025-01-12 09:12:47 字数 412 浏览 4 评论 0原文

我目前正在将本地 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

呆橘 2025-01-19 09:12:47

尝试将 CI 标志设置为 false 来构建您的 React 应用程序

 "scripts": {
    "build": "CI=false && react-scripts build",
  }

如果这不起作用,则尝试直接更改标志

CI=false react-scripts run build

*react-scripts 需要根据您使用的内容进行替换

Try to build your react app with CI flag set to false

 "scripts": {
    "build": "CI=false && react-scripts build",
  }

If this doesnt work then try directly change the flag

CI=false react-scripts run build

*react-scripts needs to be replaced depending on wht you use

九局 2025-01-19 09:12:47

--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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文