📅 October 02, 2012 ⏱ 1 min read
In the process of setting up a new Mac, I installed node.js. After the node.js installer finished, it recommended to add /usr/local/share/npm/bin
to my path. It turns out there is a very neat way to do this in OS X, the /etc/paths
file! The file contains a list (one per line) of paths that are added to the $PATH
variable in the shell. Here are some quick directions to add to the path:
sudo nano /etc/paths
echo $PATH
You should see something similar to this (including the path you’ve added!):
MacMini:~ ryan$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/share/npm/bin
Here is a screenshot of what my file looks like:
Related:
Add to the PATH on Windows 10
How to change environment variables on Windows 10
Written by Ryan Hoffman, an experienced team leader, certified Scrum Master and software architect.
Contact RyanFollow Ryan on Twitter