如何在Mac上的$ PATH中添加/ usr / local / bin [英] How to add /usr/local/bin in $PATH on Mac
本文介绍了如何在Mac上的$ PATH中添加/ usr / local / bin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
export PATH = $ PATH:/当我在终端打开.profile时, usr / local / git / bin
现在我为Mac安装了node.js, p>
确保/ usr / local / bin位于$ PATH中。
如何添加 / usr / local / bin
来导出 PATH = $ PATH:/ usr / local / git / bin
?
解决方案
export PATH = $ PATH: / usr / local / git / bin:/ usr / local / bin
这里需要引号,因为它位于任务的右侧,但一般来说,特别是在具有空间路径名传统的Mac中,扩展如 $ PATH
应该是双引号为$ PATH
。
When I do 'open .profile' in the terminal I have the following:
export PATH=$PATH:/usr/local/git/bin
Now I installed node.js for Mac and it says,
Make sure that /usr/local/bin is in your $PATH.
How can I add /usr/local/bin
to export PATH=$PATH:/usr/local/git/bin
?
解决方案
export PATH=$PATH:/usr/local/git/bin:/usr/local/bin
One note: you don't need quotation marks here because it's on the right hand side of an assignment, but in general, and especially on Macs with their tradition of spacy pathnames, expansions like $PATH
should be double-quoted as "$PATH"
.
这篇关于如何在Mac上的$ PATH中添加/ usr / local / bin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文