Skip to content

Instantly share code, notes, and snippets.

@corbanb
Last active June 1, 2021 13:49
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save corbanb/eb38bca81028585d3676 to your computer and use it in GitHub Desktop.
Save corbanb/eb38bca81028585d3676 to your computer and use it in GitHub Desktop.
OSX 10.10.X Node Developer Setup

Node.js + OSX 10.10.X

Outline

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.

Install iTerm2

https://www.iterm2.com

Install XCode

App Store

Install OSK Developer Tools

$ 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

Setup NPMRC

Info here.

$ touch ~/.npmrc

# ~/.npmrc
init.author.name=Corban Baxter
init.author.email=corbanb@gmail.com
init.author.url=http://barbershop.io
save=true
save-exact=true

Install Atom Editor

https://atom.io

# 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.

Install oh-my-zsh

https://github.com/robbyrussell/oh-my-zsh

Update oh-my-zsh config settings

$ 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"

Install Node.js

$ nvm install v0.12.7

Install Source Tree

https://itunes.apple.com/us/app/sourcetree-git-hg/id411678673?mt=12

Install local databases

$ 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
  • Psequel - Postgres GUI (link)
  • Keylord - Redis GUI (link)
  • RoboMongo - Mongo GUI (link)

Setup Heroku

  • 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

Other Dev modules

$ 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

Go Code!!

Newsletter Resources

Let the goods come to your inbox.

Node Weekly
Javascript Weekly
Redis Weekly
Postgres Weekly
HTML5 Weekly
React Weekly

@ruslan-ardashev
Copy link

ruslan-ardashev commented Apr 21, 2017

This is helpful - thanks!

The step:

"Setup Global Git Config

  • Run $ atom ~/.gitconfig
    "

Comes before "install atom"

: )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment