问题描述
我要安装 Babel .我使用的是Mac,我已经有了Sublime Text 3和新的 Package Controll 已安装.因此,我尝试 + + 打开 Package Controll ,然后输入"安装",但没有任何显示.我正在关注此链接.我需要Babel来突出显示React语法.
I want to install Babel. I'm using a Mac, I already have Sublime Text 3 and Package Controll newly installed. So I tried ++ to open up Package Controll and I typed "Install" but nothing shows up. I was following this link. I need Babel for React syntax highlighting.
推荐答案
手动:对于Babel-sublime
Manually : For Babel-sublime
如果由于某些原因控制台安装说明对您不起作用(例如在网络上具有代理),请执行以下步骤来手动安装Package Control:
If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:
1)首选项>浏览软件包
1)Preferences > Browse Packages
浏览一个文件夹,然后进入该文件夹下载Package Control.sublime-package并将其复制到Installed Packages/目录中.
Browse up a folder and then into the folderDownload Package Control.sublime-package and copy it into the Installed Packages/ directory.
对于Sublime 2
import urllib2,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
对于Sublime 3
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
然后重新启动Sublime Text
And Restart Sublime Text
想要更多信息,请单击此处
这篇关于如何在Sublime Text 3上使用Package Control安装Babel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!