在 jenkins 管道上运行以下命令
sh 'docker run --rm --name "node${commitIdLong}" -v "$(pwd)":/app -w /app node:latest /bin/bash -c "npm install; npm run build --prod --loglevel verbose"'
出现以下错误
node[1]: ../src/node_platform.cc:68:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
1: node::Abort() [node]
2: [node]
3: node::WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int) [node]
4: node::NodePlatform::NodePlatform(int, v8::TracingController*, v8::PageAllocator*) [node]
5: node::V8Platform::Initialize(int) [node]
6: [node]
7:node::Start(int, char**) [node]
8:[/lib/x86_64-linux-gnu/libc.so.6]
9: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
10:_start [node]
ERROR: script returned exit code 139
之前工作得很好,我检查了内存状态,有足够的可用内存
请参阅this线程,其中似乎包含适合您的解决方案。 简而言之,在执行
npm install
命令之前,尝试运行 ulimit -u 1024
来增加用户进程数。
该错误表明资源(ulimit)限制。
这不完全是一个
ulimit
错误,我也有类似的错误ulimit -u = unlimited
。可能是docker版本升级了。