node.js 报错解决办法 throw er; // Unhandled ‘error‘ event
原控制台输出:node:events:368throw er; // Unhandled 'error' event^Error [ERR_STREAM_WRITE_AFTER_END]: write after endat new NodeError (node:internal/errors:371:5)at ServerResponse.end (node:_http_outgoing:84
·
原控制台输出:
node:events:368
throw er; // Unhandled 'error' event
^
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at new NodeError (node:internal/errors:371:5)
at ServerResponse.end (node:_http_outgoing:846:15)
at Server.<anonymous> (D:\文档\Web视频案例\Node\server\app.js:30:13)
at Server.emit (node:events:390:28)
at parserOnIncoming (node:_http_server:951:12)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
Emitted 'error' event on ServerResponse instance at:
at emitErrorNt (node:_http_outgoing:726:9)
at processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: 'ERR_STREAM_WRITE_AFTER_END'
}
错误原因:
端口号被占用。
解决办法:
修改端口号,或者干掉端口号,重新启动项目
干掉端口号方法:
1.进入cmd命令窗口,写netstat -ano|findstr "8080
2.taskkill -PID 13512 -F
更多推荐
已为社区贡献2条内容
所有评论(0)