How to add /usr/local/bin in $PATH on Mac


Question

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?

1
89
5/7/2015 7:29:37 AM

Accepted Answer

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".

97
12/10/2013 11:13:44 PM

Try placing $PATH at the end.

export PATH=/usr/local/git/bin:/usr/local/bin:$PATH

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon