gpt4 book ai didi

node.js - events.js :174 Error: write EPIPE at ChildProcess. target._send 运行时开 Jest

转载 作者:行者123 更新时间:2023-12-05 08:05:49 30 4
gpt4 key购买 nike

Node -vv10.19.0

.\node_modules.bin\jest -v26.0.1

CPU 是 intel Xeon 16 核/32 线程和 32GB 内存

当我运行 jest --coverage 时,我总是遇到类似这样的失败

events.js:174
throw er; // Unhandled 'error' event
^

Error: write EPIPE
at ChildProcess.target._send (internal/child_process.js:762:20)
at ChildProcess.target.send (internal/child_process.js:634:19)
at ChildProcessWorker.send (C:\src\mytest\node_modules\jest-worker\build\workers\ChildProcessWorker.js:291:17)
at WorkerPool.send (C:\src\mytest\node_modules\jest-worker\build\WorkerPool.js:32:34)
at Farm._process (C:\src\mytest\node_modules\jest-worker\build\Farm.js:129:10)
at Farm._enqueue (C:\src\mytest\node_modules\jest-worker\build\Farm.js:152:10)
at Farm._push (C:\src\mytest\node_modules\jest-worker\build\Farm.js:159:12)
at Promise (C:\src\mytest\node_modules\jest-worker\build\Farm.js:90:14)
at new Promise (<anonymous>)
at Farm.doWork (C:\src\mytest\node_modules\jest-worker\build\Farm.js:56:12)
Emitted 'error' event at:
at process.nextTick (internal/child_process.js:766:39)
at process._tickCallback (internal/process/next_tick.js:61:11)

我试过以管理员权限运行命令行窗口。添加参数,例如 --maxWorkers=4设置 NODE_OPTIONS= --max-old-space-size=4096

都因相同的错误而失败。

如果我使用参数--runInBand,我会得到

events.js:174
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open ''
Emitted 'error' event at:
at lazyFs.open (internal/fs/streams.js:115:12)
at FSReqWrap.args [as oncomplete] (fs.js:140:20)

任何帮助将不胜感激。

最佳答案

这可能是 running out of memory 的问题.你可能有内存泄漏,这显然是 jest 的设计 pretty easy to do .该链接还描述了如何调查内存泄漏。

关于node.js - events.js :174 Error: write EPIPE at ChildProcess. target._send 运行时开 Jest ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63296621/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com