If you are not aware, MEAN is a fullstack JavaScript framework comprised of MongoDB, express, AngularJS, and nodejs. This JS app stack is extremely flexible and I wanted to learn more about the underlying technologies used in MUSE. To get started, I figured I would fire up an Ubuntu server and install the stack. Sounded like a simple enough task, and obvious place to begin. After a day or so of failed attempts, hunting down error messages, troubleshooting, and piecing together documentation from the four corners of the internet, I have the formula for making the stack work. Here are my notes in the event they prove to help anyone else. (and so I don't forget)
I started with Ubuntu 14.04 LTS. As always I immediately ran the apt commands to refresh the repo information and then install the latest patches. I will assume that the readers know how to do this, and a fully patched Ubuntu 14.04 LTS installation is the starting point.
PROCESS:
- First I needed to install a few things to make the environment ready for development tasks.
sudo apt-get install gpm vim vim-doc vim-scripts build-essential curl git - One of the issues I encountered was a WRITE SAME error when installing MongoDB. To prevent that issue, I found a helpful script in an article (referenced) linked here to address the issue:
http://ewen.mcneill.gen.nz/blog/media/disable-write-same - Next I needed to install MongoDB on my own. I followed the instructions provided in the link found in the reference section to mongodb.org. They were:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org - After installing MongoDB, I then continued on to install nodejs. I was able to follow the simple instructions from the mean.io site.
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get update
sudo apt-get install nodejs - TIP: BE SURE TO INSTALL GIT IF YOU MISSED IT EARLIER!!
- Git installs and does not always setup the git:// protocol resolution correctly. To compensate for that I had to run:
git config --global url."https://".insteadOf git:// - With MongoDB, Node ,and the necessary underlying system stuff underway, I now turned my attention to the mean tools.
npm install -g grunt-cli
npm install -g bower
npm install -g mean-cli - With mean installed, I now had the stack, but there is a default administration application that needed to be setup. I used mean to initialize the default admin application.
mean init <myApp> (where <myApp> is the name of whatever you want to call your default application)
cd <myApp> && npm install - Now I started the application I just setup.
grunt - I then just pointed my browser at my server on port 3000 and was able to see the default app.
http://<server.name>:3000
REFERENCE:
http://learn.mean.io/#m-e-a-n-stack-installation
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/?_ga=1.210389661.982565409.1424984373
http://askubuntu.com/questions/449232/problem-installing-14-04-in-vmplayer
I'd prefere CANE (CouchDB, Angular, Node, Express)
ReplyDeleteThanks for the tip NotesSensei. Definitely going to check it out as well.
Delete