node.js - Next.js 在 Ubuntu EAGAIN 上构建失败
问题描述
我在 Ubuntu 18.04(4 核,8gb ram)上构建 next.js 应用程序时遇到问题。它在我的本地 Windows 机器上运行良好,但在我的 ci 服务器上失败并出现以下错误。该应用程序只是启用了 typescript 的初始默认应用程序。我在节点 v14.15.1 上。
错误:
frontend@0.1.0 build /root/builds/sbhwz7X3/0/xxx/xxx/frontend
next build
info - Creating an optimized production build ...events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn /usr/bin/node EAGAIN
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn /usr/bin/node',
path: '/usr/bin/node',
spawnargs: [
'/root/builds/sbhwz7X3/0/xxx/xxx/frontend/node_modules/jest-worker/build/workers/processChild.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-22T21_35_14_729Z-debug.log
包.json:
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next export",
"start": "next start"
},
"dependencies": {
"next": "10.0.1",
"react": "17.0.1",
"react-dom": "17.0.1"
},
"devDependencies": {
"@types/node": "^14.14.9",
"@types/react": "^16.9.56",
"typescript": "^4.0.5"
}
}
在其他线程上,我读过有关进程限制干扰的信息,但看起来这应该不是问题。
ulimit -a:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1029354
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 62987
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
解决方案
推荐阅读
- dialogflow-es - 在另一个意图结束时触发一个意图
- python - 在缩进中赋值给变量
- python-3.x - 如何将sklearn线性回归系数和截距转换为3位小数?
- testing - 如何在 Cucumber-QAF 设置中跳过通过的测试用例
- reactjs - 更改的开玩笑输入未触发/模拟
- reactjs - 如何使用反应样式组件添加自定义 CSS
- gradle - gradle 中 JUnit 5 和 JUnit 4 的不同配置
- reactjs - 你可以将 scss 文件作为道具传递给另一个反应组件来使用吗?
- c# - WCF XML反序列化不填充数组
- r - 使用 dplyr 根据模式过滤数据帧并重新排序