Install Node.js by nvm

Install nvm

curl https://raw.github.com/creationix/nvm/master/install.sh | sh

Add source file to your bash(if zsh,add it to ~/.zshrc)

source ~/.nvm/nvm.sh

Reference

https://github.com/creationix/nvm

Install a special version of Node.js

nvm install 0.10

Check installed versions

nvm ls

Set default version

nvm alias default v0.10.18

Install express

npm install -g express

Create a application

express --sessions myapp

Install dependencies

cd myapp && npm install

Run the app

node app

Reference

http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/
Advertisements