修改VSCode远程SSH的PATH

bash 复制代码
# echo $PATH
/root/.vscode.../server/bin/remote-cli:/root/.nvm/versions/node/v16.20.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

修改VSCode用户设置

  • 在VSCode中按 Ctrl+Shift+P,搜索Preferences: Open Settings (JSON)
  • 添加
bash 复制代码
{
  "terminal.integrated.env.linux": {
    "PATH": "/root/.nvm/versions/node/v22.17.1/bin:${env:PATH}"
  }
}
bash 复制代码
# node --version
v22.17.1