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

来源:互联网 发布:数据库关联查询sql语句 编辑:程序博客网 时间:2024/05/16 02:13

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 PATH18:25:44  gjsmith3rd@DV7:~ 18:21:36  gjsmith3rd@DV7:~ $which node/usr/bin/node18: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.


0 0
原创粉丝点击