这两天在centos下,直接用vscode运行egg.js的例子。遇到个问题就是当安装了vscode-egg插件,会遇到一个现象。就是一样的代码,Windows下调试能够顺利进行,可是centos有时候好,有时候不行,由于也是刚刚在作这一块工做,知其然,不知其因此然。javascript
在egg.js下发了帖子。明白了道理java
https://github.com/eggjs/egg/issues/3283node
根本缘由就是参数配置区别;git
其中,--inspect-brk
是指在进程第一行就暂停,等待 attach,所以:github
配置我这里发一下npm
1.会出现停住的配置:centos
{
"type": "node",
"request": "launch",
"name": "Egg Debug",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"debug",
"--",
"--inspect-brk"
],
"console": "integratedTerminal",
"restart": true,
"protocol": "auto",
"port": 9229,
"autoAttachChildProcesses": true
},
2.修改后的配置spa
{
"type": "node",
"request": "launch",
"name": "Egg Debug",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"debug",
"--",
"--inspect"
],
"console": "integratedTerminal",
"restart": true,
"protocol": "auto",
"port": 9229,
"autoAttachChildProcesses": true
},