這兩天在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
},