1

几乎每周我都会从 nodejs 服务器收到此错误:

Error: write ECONNRESET
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
    at handleWriteReq (internal/stream_base_commons.js:56:21)
    at writeGeneric (internal/stream_base_commons.js:139:15)
    at TLSSocket.Socket._writeGeneric (net.js:770:11)
    at TLSSocket.Socket._write (net.js:782:8)
    at doWrite (_stream_writable.js:431:12)
    at writeOrBuffer (_stream_writable.js:415:5)
    at TLSSocket.Writable.write (_stream_writable.js:305:11)
    at abortConnection (/home/armweb/www/node_modules/engine.io/lib/server.js:509:12)
    at /home/armweb/www/node_modules/engine.io/lib/server.js:356:7 {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'write'
}

是什么原因?

4

1 回答 1

1

这是因为您的节点服务器没有正确关闭,但是您已经启动了另一个节点进程。如果您使用 Linux,请按照以下步骤操作:

  1. ps-辅助 | grep 节点(获取节点进程号)
  2. sudo kill process_number
  3. 启动你的节点进程
于 2020-03-18T08:34:20.110 回答