Skip to content

Node.js Environment Setup

hunt edited this page Mar 15, 2013 · 1 revision

Mac OS X’s Way (mountain lion)

Setup

  1. Install latest version of Xcode from Appstore (this process require Apple ID) file's size about 1.6GB
  2. Enable Command Line tools by goto menu "Xcode > Preference" on "Downloads" tab. Hit "Install" button at Command Line Tools. (about 100MB) After this process you can access GCC compiler from terminal.
  3. Now you got latest GCC and all compiler tools that you need. Now time to install package manager for Mac. We using Homebrew (instead of macport) or use this code on your sheel. ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
  4. Install git by brew install git
  5. Install Node version manager. We using NVM install by this command curl https://raw.github.com/creationix/nvm/master/install.sh | sh To activate NVM on every terminal session you should add this line . ~/.nvm/nvm.sh to ~/.profile
  6. Now you got version control of node. If you want to use node 0.6.14 just type nvm install 0.6.14. List version of node by nvm ls You may need to set default version of node by nvm alias default 0.6 for using latest version of node 0.6.x To confirm you got node. node -v for checking your current node version.
  7. Now you got Node! Now time for node package manager (NPM). Install by this command curl https://npmjs.org/install.sh | sh to download npm script and install Now everything you get everything you need to explore the world of Javascript by Node!

Some libraries we usually use

Caching

brew install redis
npm install redis hiredis

Mongodb

brew install mongo
npm install mongoose

Some useful configuration

  • To disable key press holding (repeat...) from Lion defaults write -g ApplePressAndHoldEnabled -bool false and restart your current using app

  • To Increase cursor speed in terminal go to System Preferences => Keyboard => Key Repeat Rate && Delay Until Repeat


Ubuntu’s Way