Angular ng 构建抛出错误写入 EPIPE
Angular ng build throws error write EPIPE
我尝试使用 ng build
构建一个 angular 应用程序,但出现此错误:
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:164:15)
at writeGeneric (node:internal/stream_base_commons:155:3)
at Socket._writeGeneric (node:net:795:11)
at Socket._write (node:net:807:8)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at Socket.Writable.write (node:internal/streams/writable:334:10)
at Object.writeToStdin (/home/[user]/example/node_modules/esbuild-wasm/lib/main.js:1864:19)
at sendRequest (/home/[user]/example/node_modules/esbuild-wasm/lib/main.js:637:14)
at start (/home/[user]/example/node_modules/esbuild-wasm/lib/main.js:1274:9)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at runNextTicks (node:internal/process/task_queues:65:3)
at processImmediate (node:internal/timers:437:9) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
我查了很多这样的问题都没有解决我的问题。此错误与其他错误略有不同。
Angular版本:
Angular CLI: 13.2.2
Node: 16.13.2
Package Manager: npm
OS: linux x64
Angular: 13.1.1
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1301.2
@angular-devkit/build-angular 13.1.2
@angular-devkit/core 13.1.2
@angular-devkit/schematics 13.2.2
@angular/cli 13.2.2
@schematics/angular 13.2.2
rxjs 7.4.0
typescript 4.5.4
如有任何帮助,我将不胜感激
降级 Angular
和 Node
版本就成功了。
Angular CLI 13.2.2 -> 12.2.16
Node 16.13.2 -> 14.19.0
对于遇到此问题的任何其他人:我在 docker 构建(ng 12,节点 16)中遇到了这样的错误。我的问题原来是我在我的构建上下文中无意中运送了 node_modules,可能包含来自我的 mac 盒子的一些干扰 linux 中的构建。将 node_modules 添加到 .dockerignore 解决了问题。
我尝试使用 ng build
构建一个 angular 应用程序,但出现此错误:
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:164:15)
at writeGeneric (node:internal/stream_base_commons:155:3)
at Socket._writeGeneric (node:net:795:11)
at Socket._write (node:net:807:8)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at Socket.Writable.write (node:internal/streams/writable:334:10)
at Object.writeToStdin (/home/[user]/example/node_modules/esbuild-wasm/lib/main.js:1864:19)
at sendRequest (/home/[user]/example/node_modules/esbuild-wasm/lib/main.js:637:14)
at start (/home/[user]/example/node_modules/esbuild-wasm/lib/main.js:1274:9)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at runNextTicks (node:internal/process/task_queues:65:3)
at processImmediate (node:internal/timers:437:9) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
我查了很多这样的问题都没有解决我的问题。此错误与其他错误略有不同。
Angular版本:
Angular CLI: 13.2.2
Node: 16.13.2
Package Manager: npm
OS: linux x64
Angular: 13.1.1
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1301.2
@angular-devkit/build-angular 13.1.2
@angular-devkit/core 13.1.2
@angular-devkit/schematics 13.2.2
@angular/cli 13.2.2
@schematics/angular 13.2.2
rxjs 7.4.0
typescript 4.5.4
如有任何帮助,我将不胜感激
降级 Angular
和 Node
版本就成功了。
Angular CLI 13.2.2 -> 12.2.16
Node 16.13.2 -> 14.19.0
对于遇到此问题的任何其他人:我在 docker 构建(ng 12,节点 16)中遇到了这样的错误。我的问题原来是我在我的构建上下文中无意中运送了 node_modules,可能包含来自我的 mac 盒子的一些干扰 linux 中的构建。将 node_modules 添加到 .dockerignore 解决了问题。