我正在尝试调试运行npm start
或npm run-script debug
时出错的节点模块。
这些是 package.json
中的脚本 "scripts": {
"start": "webpack-dev-server --port 9229 --env.mode development",
"debug": "webpack-dev-server --port 9229 --env.mode development",
"test": "echo \"Error: no test specified\" && exit 1"
},
并在VS Code的 launch.json
中{
"version": "0.2.0",
"configurations": [
{
"name": "Launch via NPM",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script", "debug"
],
"port": 9229
}
]
}
当我开始调试时,它不会中断我在 webpack.config.js 或 node_modules 中设置的任何断点,但它会输出错误我是进入VS Code的调试控制台。