Server Crashing with "Cannot set headers after they are sent to the client"
Phenomenon
I want to set up a local server using http-server and check the contents of a static html file.
When I start http-server with the following command
http-server -c-1
error in title occurred.
Solution
I don't really know the cause, but it seems to be caused by an old version of node.js.
The above phenomenon occurred in version 10, but after upgrading to version 16, the error no longer occurred
Comments