nvm和vscode配合使用

27 阅读1分钟

console使用.nvmrc

v18.20.4

vscode launch.json

{
  // 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",
      "name": "Launch Program",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "pnpm",
      "runtimeArgs": ["run", "dev"],
      "runtimeVersion": "18",
      "console": "integratedTerminal"
    }
  ]
}

runtimeVersion会读取nvm的版本,nvm配置

nvm alias v18.20.4 18