I have a problem with building my next.js application on my Ubuntu 18.04 (4 cores, 8gb ram). It works fine on my local windows machine but fails with the following error on my ci server. The application is just the initial default app with typescript enabled. I am on node v14.15.1.
Error:
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
package.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"
}
}
On other threads I have read about process limits interfering, but it doesn't look like that should be a problem.
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