Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开发环境 --inspect 调试方式 #145

Open
lovelmh13 opened this issue Jul 26, 2021 · 0 comments
Open

开发环境 --inspect 调试方式 #145

lovelmh13 opened this issue Jul 26, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

开发使用 --inspect 来调试可以在 chrome 中调试 Node。

如果有多个项目同时使用 --inspect,那么会报错:9229 端口被占用。

原因是 --inspect 默认使用 9229 端口来,只需要在指定其他端口来调试就可以了。

例如 :

"dev": "NODE_ENV=dev node -r ts-node/register --inspect=9228 ./src/app/index.ts"

如果在项目中, proxy 反向代理配置 --inspect 调试的项目的接口错误,还会显示:WebSockets request was expected。还是只需要改变 --inspect 端口防止端口冲突就可以了。因为这个调试的原理是使用 WebSockets。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant