This post illustrates the procedure of installing gulp and bower, two node modules, on Mac OSX.
First, assuming you’ve already installed Homebrew on Mac, search for the correct version of node.
brew search node
The version currently recommended by nodejs organization is 4.4.7-lts. So that here we install this version.
brew install homebrew/versions/node4-lts
Then we can test whether the installation is successful by viewing the versions of node and npm.
Here comes a trick before installing node modules gulp and bower. We have to change npm configuration as follows.
npm config set prefix /usr/local
After the above step, we can install gulp and bower respectively using the commands below.
npm install gulp -g
npm install bower -g
Now gulp and bower have already been successfully installed on your Mac. You can test by the following commands.