解决:mac visual code1.8.1 运行时提示:无法在 PATH 上找到运行时”node“。

mac visual code1.8.1 运行时提示:无法在 PATH 上找到运行时”node“。

找了半天,说怎么替换掉node.js的路径,例如这个

https://segmentfault.com/q/1010000005793371/a-1020000005812628

Mac Terminal: 

1. $ which node 得出node.js真实路径 /path/to/node 

2. $ ln -s /path/to/node /usr/local/bin/node 注意替换 /path/to/node


但我总是不信,我觉得不应该啊,因为已经在终端里可以执行node 和npm命令了

这里只是设置的问题。

虽然我是安装了nvm来管理node 版本。


再百度:到鬼佬的网站: http://stackoverflow.com/questions/31075763/vscode-0-3-cant-find-runtime-node-on-path 有用的部分看文章末尾。

我是这样解决问题:

用终端:

echo $PATH

弹出:

/Users/mac/.rvm/gems/ruby-2.3.0/bin:/Users/mac/.rvm/gems/ruby-2.3.0@global/bin:/Users/mac/.rvm/rubies/ruby-2.3.0/bin:/Users/mac/.nvm/versions/node/v5.1.0/bin:/Applications/Cocos/tools/ant/bin:/Applications/Cocos/frameworks:/Applications/Cocos/frameworks/cocos2d-x-3.9/tools/cocos2d-console/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mac/.rvm/bin


which node

弹出: 

/Users/mac/.nvm/versions/node/v5.1.0/bin/node

到 vs code 的查找:runtimeExecutable

原来的值是null, 

改为 “/Users/mac/.nvm/versions/node/v5.1.0/bin/node”

再运行就好了。

good boy!


NODE PATH FOR VSCODE VERSION 0.7.0


I'm running Ubuntu GNU/Linux 12.04.5 LTS. Before VSCode 0.7.0 I would leave my node path to the default found on the PATH in the launch.json file:

// Workspace relative or absolute path to the runtime executable to       be used. Default is the runtime executable on the PATH.
        "runtimeExecutable": null,

However, after the update to 0.7.0, I started receiving 'can't find runtime on "node" PATH'errors even though node was on my PATH.

18:25:37  gjsmith3rd@DV7:~ 
$echo $PATH
/usr/bin:...//Plus the rest of the PATH
18:25:44  gjsmith3rd@DV7:~ 

18:21:36  gjsmith3rd@DV7:~ 
$which node
/usr/bin/node
18:21:43  gjsmith3rd@DV7:~

I changed my launch.json to:

// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
        "runtimeExecutable": "/user/bin/node",

Now all is working fine. The actual path is /usr/bin/ and the executable is node.


  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值