node.js - 如何在vscode debug nodejs的时候使用nodemon

 布瓜Pourqu2502854853 发布于 2022-11-06 13:59

如何在 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"
  }
}
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有