Below is a quick start guide to developing node.js on OSX. These tools and settings will give you just about everything you would need on a clean install of OSX 10.10.X to get setup and coding.
$ xcode-select --install
Install Homebrew (http://brew.sh)
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install zsh, git and nvm
$ brew install zsh git nvm node
Setup Global Git Config
- Run
$ atom ~/.gitconfig
# ~/.gitconfig
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
Info here.
$ touch ~/.npmrc
# ~/.npmrc
init.author.name=Corban Baxter
[email protected]
init.author.url=http://barbershop.io
save=true
save-exact=true
# Install Atom Plugins
$ apm install linter linter-eslint sublime-style-column-selection
$ sudo gem install scss_lint # install the scss linter
$ apm install linter-scss-lint atom-material-ui atom-material-syntax file-icons todo-manager save-session docblockr javascript-snippets atom-beautify bottom-dock emmet es6-identifier-highlight es6-highlight
Make ZSH Default SHELL link
iTerm2 -> Preferences -> Profiles -> Default
and in the General Tab
set the Command
to /usr/local/bin/zsh
instead of Login shell.
https://github.com/robbyrussell/oh-my-zsh
$ atom ~/.zshrc
(info)
Plugins (link)
plugins=(atom bower brew composer cloudapp coffee git github git-hubflow heroku meteor node npm nvm pip redis-cli postgres rails rvm urltools xcode)
Aliases:
$ touch ~/.oh-my-zsh/custom/aliases.zsh
$ atom ~/.oh-my-zsh/custom/aliases.zsh
# aliases.zsh
alias zshconfig="atom ~/.zshrc"
alias ohmyzsh="atom ~/.oh-my-zsh"
export NVM_DIR=~/.nvm
. $(brew --prefix nvm)/nvm.sh
# Shorter Git alias
alias g="git"
$ nvm install v0.12.7
https://itunes.apple.com/us/app/sourcetree-git-hg/id411678673?mt=12
$ brew install postgres redis mongodb
# Launch at startup
$ mkdir -p ~/Library/LaunchAgents
# Postgres auto load
$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
# Load Postgresql now
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
# Init db
$ initdb `brew --prefix`/var/postgres/data -E utf8
# Create first postgres db
$ createdb $USER
# Redis Auto Load
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
# Load Redis Now
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
# Mongo Auto Load
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
# Load mongo now
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
- Install CLI https://toolbelt.heroku.com
- Create Work Heroku Account
- Setup Heroku multi-accounts plugin (link)
- Run
$ heroku plugins:install git://github.com/ddollar/heroku-accounts.git
- Run
$ heroku accounts:add work --auto
$ npm i -g browserify webpack gulp bower yo # build tools
$ npm i -g nodemon node-inspector pm2 # debug tools
$ npm i -g eslint babel-eslint eslint-config-airbnb #linting tools see http://blog.lauritz.me/linting-javascript-in-2015/
# or all at once
$ npm i -g browserify webpack gulp bower yo nodemon node-inspector pm2 babel-eslint eslint-config-airbnb
Let the goods come to your inbox.
Node Weekly
Javascript Weekly
Redis Weekly
Postgres Weekly
HTML5 Weekly
React Weekly
This is helpful - thanks!
The step:
"Setup Global Git Config
"
Comes before "install atom"
: )