After the local web service starts, the browser cannot access it.

initially compiled successfully using webpack-dev-server, but accessing localhost reported an error 502.

remove node_modules, reinstall, build, still can"t open localhost.

feels that it is not a matter of webpack-dev-server. Try express,http-server, and the result is:

All the

command lines show that they are running normally, but they just can"t call to access localhost.

have you ever met a boss?


you need to see what the port number is for your webpack-dev-server configuration. The default seems to be 8080 , and direct access must be 404. Visit http://localhost:8080 to try


in general, the port is occupied, just change it.
if you are using mac,8080, it is already occupied by the system.


lsof-I: the port number confirms that the service is enabled first.
if there is no node, then the service is not enabled successfully, but without node, remember pid sudo kill-9 pid
and then try to visit 0.0.0.0 or 127.0.0.1
if ok is your host problem
if not ok, continue to wait for a reply.

Menu