如何在 vscode debug nodejs的时候使用 nodemon, 原本直接运行 npm start node程序, 但是目前我想改为在 vscode 编辑器中直接按下 F5 启动 node程序(即通过 launch.json 启动), 那么我该如何把 package.json 中的 start 修改为对应的 launch.json 具有同等作用呢?
package.json 中的 scripts为:
"scripts": {
"start": "./node_modules/.bin/nodemon bin/run"
}
launch.json 配置如下:
"configurations": [
{
"type": "node",
"request": "launch",
"name": "启动程序",
"program": "${workspaceRoot}\\bin\\run",
"cwd": "${workspaceRoot}",
"env": {
"NODE_ENV": "development"
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号