mac: vscode插件Code Runner报错:/bin/sh: node: command not found

在vscode中使用插件Code Runner时报错,导致无法运行:/bin/sh: node: command not found

原因:没有找到node

解决方法:

  • 在终端中输入【which node】,找到node可执行文件的路径;
    image.png
  • 修改vscode设置
    mac: vscode插件Code Runner报错:/bin/sh: node: command not found_第1张图片
  • 输入Executor Map,然后再settings.json中编辑;
    mac: vscode插件Code Runner报错:/bin/sh: node: command not found_第2张图片
  • 把node可执行文件的路径替换到这里;
    mac: vscode插件Code Runner报错:/bin/sh: node: command not found_第3张图片
  • 完成,可以舒畅的运行了~

你可能感兴趣的:(nvscode插件)