Installing the MEAN Stack on Cloud9

Create a new Node.js workspace, then enter the following in the shell:

rm -rf *
nvm install stable
echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/versions/node/v0.12.7/lib/node_modules" >> ~/.bashrc
source ~/.bashrc
npm install -g npm
npm install -g yo
npm install -g grunt
npm install -g grunt-cli
npm install -g bower
npm install -g generator-angular-fullstack

Make sure that you use the updated Node.js version when you update NODE_PATH.

You can then deploy the Angular.js scaffold:

yo angular-fullstack

Answer the questions thusly:

Javascript, Yes (ES6), HTML, CSS, ngRoute, Yes (Bootstrap), Yes (UI Bootstrap), Yes (Mongoose), Yes (authentication), Twitter, No (socket.io)

Yeoman will then attempt to run bower and npm to install dependencies. If it fails, run these two commands:

bower install
npm install

Next, we'll set up MongoDB:

mkdir data
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"' > mongod
chmod a+x mongod
./mongod

Open a new terminal window (since the once you were just working in is now busy with MongoDB), and start the server:

grunt serve

Due to the small amount of memory available on a micro instance, I had to delete the node_modules directory and run 'npm cache clean', then 'npm install' again to resolve an error I was getting when trying to start the server.