【发布时间】:2019-12-28 09:35:57
【问题描述】:
这是我的 VS 代码launch.json 文件:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4321",
"port": 9222,
"webRoot": "${workspaceFolder}"
}
]
}
我想要的是在调试开始之前运行npm start 命令,即运行开发服务器然后启动 Chrome 实例并导航到提供的 URL。
所以,我在配置文件中添加了以下 sn-p 并运行调试:
"cwd": "${workspaceRoot}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
]
但我得到了这个错误:
Attribute runtimeExecutable does not exist ('npm')
有什么帮助吗?
【问题讨论】:
标签: debugging npm visual-studio-code