问题
When I run nodemon dist/server/app.js
it works on default port 3000
and I'm able to reach my API. But if I run nodemon --inspect-brk=localhost:3000 dist/server/app.js
, I got error saying "WebSockets request was expected". What's wrong?
回答1:
You can't run your web server and the debugger on the same port. They are each separate servers (the debugger is a server built into the node.js runtime).
So, you can either remove the port and host designation from the --inspect-brk
option and just let it use the defaults (which is all I ever use) or you can select a different port for the debugger that doesn't conflict with your web server or anything else running on that host.
来源:https://stackoverflow.com/questions/49766500/websockets-request-was-expected-error-when-using-inspect-brk-option