likes
comments
collection
share

vscode-Code Runner运行js失败

作者站长头像
站长
· 阅读数 16

有时候我们会直接在 vscode 添加一个 js 文件,用于测试我们的部分代码,使用 coder runner 直接运行,方便又快捷

可是有一天突然报错 /bin/sh: node: command not found 错误,实际我们使用 node 执行是没有问题的,我们只需要改动一下 vscode 配置即可

打开设置,设置 setting.json 即可

vscode-Code Runner运行js失败

vscode-Code Runner运行js失败

里面默认 JavaScriptnode,只需要改成我们实际的node地址即可

vscode-Code Runner运行js失败

实际 node地址 不知道的话,可以使用下面命令获取 地址,然后直接复制粘贴地址即可,之后便可以运行了

where is node
转载自:https://juejin.cn/post/7288116632785698831
评论
请登录