无法使Sublime Text 3命令行工具正常工作 [英] cannot get sublime text 3 command line tools to work

查看:171
本文介绍了无法使Sublime Text 3命令行工具正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使Sublime Text 2命令行工具正常工作.当我下载Sublime Text 3时,我无法使用命令行工具.我在这里尝试了所有答案:打开Sublime来自macOS终端中的文本.当我键入:

I had sublime text 2 command line tools working. When I downloaded Sublime Text 3, I could not get the command line tools to work. I've tried every answer here: Open Sublime Text from Terminal in macOS. When I type:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl  

我回来了:

ln: /usr/local/bin/subl: File exists

但是无论如何我仍然会得到 -bash:subl:命令未找到

but no matter what I do I still get back -bash: subl: command not found

推荐答案

先删除现有链接.它必须是断开的链接.

Remove the existing link first. It must be a broken link.

列出目录的内容,您会发现链接已断开:

List the contents of the directory and you'll see that the link is broken:

$ ls -Al /usr/local/bin/

以上命令的输出将显示现有链接指向不存在的文件.因此,删除断开的链接:

Output from the above command will show that the existing link is pointing to a non existing file. So delete the broken link:

$ rm /usr/local/bin/subl

您可能需要对以上命令使用sudo.

You might need to use sudo for the above command.

现在您可以创建符号链接:

Now you can create the symlink:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

这篇关于无法使Sublime Text 3命令行工具正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆