To go angular.js on Mac Os X from scratch, you need to do a couple of installation task ; After spending a full afternoon I can tell you it is not as easy as on Linux but now it works. Hope these line will help you to fire it in less than 15 minutes.
Install XCode
- you can do it from AppStore, search for XCode then install it, it’s free and about 2.3GB of dowload.
- Now you have to accept the license
# sudo xcodebuild -license
This step is a pre-requisite to use xcode. Follow the requested procedure, hit space until the end of the document (you should read by-the-way) and type agree at the end.
Install Node.Js
- Create directory to handle webSites
# mkdir ~/Sites # sudo ln -s ~/Sites /Library/WebServer/Documents
- install howebrew
# ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" # brew doctor
- install node
# brew install node
Install compass & yo
# sudo gem install compass # npm install -g yo # bower install
Create project
- Create project directory
# cd ~/Sites # mkdir HelloWorld # cd HelloWorld
- Install node modules (should not be needed … but it is)
# npm install yo generator-angular
Yo have a dependency on bower, grunt-cli so they are automatically installed
- Create application template
# ./node_modules/.bin/yo angular HelloWorld # grunt serve
I assume it is not the right way to do it, it would be better to install yo and generator-angular globally instead of locally. But when doing this on mac os X, the node_path are not correctly initialized and yo is not able to find the modules… this is a bypass I had to use. Any help welcome in the comments.