vsCode launch.json文件中如何指定node版本

733 阅读1分钟

有时候vsCode调试node项目时,运行的node版本过低的问题,可以增加runtimeVersion 指定调试的node版本。 配置文件如下:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "runtimeVersion": "16.14.2",
      "name": "debug nest",
      "runtimeExecutable": "npm",
      "args": ["run", "start:dev"],
      "skipFiles": ["<node_internals>/**"],
      "console": "integratedTerminal"
    }
  ]
}