我正在尝试在Visual Studio代码的launch.json文件中运行以下npm脚本:
nodemon src/shim-host/index.js --exec babel-node --babel-preset-es2015
到目前为止我在launch.json
文件中的尝试:
"program": "nodemon src/shim-host/index.js --exec babel-node --babel-preset-es2015",
但是,我收到错误"Attribute 'program' is not absolute'"
有人可以帮忙吗?
提前致谢!
答案 0 :(得分:3)
program属性是你的代码,nodemon应该是runtimeExecutable。
来自Inspect service workers with Chrome的示例:
{
"name": "Launch server.js via nodemon",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "nodemon",
"runtimeArgs": [
"--debug=5858"
],
"program": "${workspaceRoot}/server.js",
"restart": true,
"port": 5858,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}