All commands assume you are at the prompt. The prompt seperator “$” has been ommited.
Download Xcode from App Store. then open Xcode and select the following. As of Xcode 8.2 the Developer Tools are installed automatically.
Preferences > Downloads > Command Line Tools
Homebrew makes installing programs and packages insanely easy on a Mac. Open Terminal and type the following, then follow the steps it gives you.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
See Install Git from Atlassian’s Become a Git Guru for more details and other installations.
Apple includes their own fork of Git in the Xcode Developer Tools, but it tends to lag behind mainstream Git by several major versions. You may want to install a newer version of Git using one of the methods below.
- Download the latest [Git for Mac installer] (https://sourceforge.net/projects/git-osx-installer/files/)
- Follow the prompts
- Open a terminal and verify the installation was successful
git --version
- Configure your Git username and email using the following commands, replacing “Your Name” name with your own. These details will be associated with any commits that you create:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
- Open your terminal and install Git using Homebrew
brew install git
- Configure your Git user name as detailed above.
- Verify the installation was successful
git --version
We’ll use Node Version Manager and install with Homebrew. See: https://tecadmin.net/install-nvm-macos-with-homebrew/
We’ll use Homebrew to install Node.js, which is the server-side JavaScript environment that Gulp runs in. Node.js comes with npm, the Node Package Manager. Run a command to install Node globally:
brew install node
This will install the Gulp command line, globally. Run this command to install Gulp globally:
npm install --global gulp-cli
This is the last global step before we start installing things locally—on a per project basis. Run this command to install Bower globally:
npm install -g bower
If Node is already installed, install Yarn on its own
brew install yarn --without-node
brew install yarn --ignore-dependencies
Run a command to install Node and Gulp to the local project folder:
npm install
Run a command to install Bower. Be sure you are installing in the correct location. The bower.json file must be present. If this is a WordPress project, there is a good chance that these components will need to be installed into the specific theme you are working on.
bower install
If it has been awhile since your last commit you may need to update your tools.
Check the versions of your tools:
node -v
npm -v
gulp -v
bower -v
yarn -v
brew doctor
brew update
brew upgrade node
npm update
This updates all local packages.
Node comes with NPM installed so you should have a version of NPM. However, NPM gets updated more frequently than Node does, so you’ll want to make sure it’s the latest version.
npm install npm@latest -g
brew upgrade yarn
If you’ve previously installed Gulp globally, use the following command to remove Gulp first:
npm rm --global gulp
Then reinstall the Gulp commandline interface globally with the following command:
npm install --global gulp-cli
Yes, it is confusing. You can’t simply update Gulp globally. Read the Gulp documentation for a more detailed explination of this rational.
Find newer versions of package dependencies than what your package.json or bower.json allows. Install NPM Check Updates.
Need to know the location of Node, NPM, Gulp, or Bower? The following commands will print out the path to the installation.
which node
which npm
which gulp
which bower
(How to update out of date package.json)[https://www.themarketingtechnologist.co/how-to-update-an-out-of-date-package-json/]