我最近升级了我的vscode,现在当我尝试运行该服务时出现此错误:
D:\herokuworkspace\server/node_modules/.bin/babel-node.CMD --inspect-brk=27776 src\index.js
D:\Program Files\nodejs\node.exe: bad option: --inspect-brk=27776
这是我的配置:
{
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/babel-node",
"name": "Launch Program",
"program": "${workspaceFolder}/src/index.js",
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart"
}
请告知我应该在配置中更改什么才能使其再次运行。
答案 0 :(得分:5)
你的标题是节点8,但看起来你使用的是不支持--inspect-brk
标志的旧版Node。您可以升级到Node 7.6之后的版本,或者您可以在启动配置中设置旧的调试args(添加端口和runtimeArgs):
{
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/babel-node",
"runtimeArgs": [ "--inspect=1234", "--debug-brk" ],
"port": 1234,
"name": "Launch Program",
"program": "${workspaceFolder}/src/index.js",
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart"
}