Judging by the myriad of blog posts out there, it appears most of the developers out there using the MEAN stack are predominantly using MacBooks etc. However, this doesn’t mean you can’t develop using the mean stack on Linux. There are just a few tweaks you need to do to get it running.
Install MongoDB and Node.js on your ubuntu desktop;
[/ebs_panel-header] [ebs_panel-content] In order to make life easier I have created a quick bash script to install all necessary components to get up and running with meanjs. After executing the bash script you can go directly to Get a project up and running with mean.js [wpdm_package id=’5515′] [/ebs_panel-content] [ebs_panel-footer] [ebs_icon type=”glyphicon glyphicon-question-sign” color=”#1e73be”] How to execute BASH Scripts
In order to use the mean.js you will need to install the yeoman generator , which is a scaffolding tool for web applications. Yeoman helps you kickstart new projects, prescribing best practices and tools to help you stay productive.
sudo npm install -g generator-meanjs
This is will install the generator and you’re almost ready to install Mean.js, however in order to get yeoman to work on your ubuntu machine there is one little hack you need to do. Yeo man needs to run using your superuser permissions, so you need to create a bash script for it to do so.
echo prefix = ~/.node >> ~/.npmrc echo 'export PATH=$HOME/.node/bin:$PATH' >> ~/.bashrc . ~/.bashrc
Once you’ve done that you can run simply run the yeoman generator,
sudo apt-get install ruby-full
sudo su -c "gem install sass"
Although we have completed a few basics on how to generate a project with mean.js, there as still a few little quirks to remove friction points on your ubuntu desktop. I’ll guide you through a process of how I successfully got this to work.
I’ll create a little demo project and use my favourite IDE WebStorm by jetbrains
First step is step is to create a directory for your project and then change directory
mkdir meanjsdemo && cd meanjsdemo
Secondly generate your meanjs project
The generator will now start and you will need to answer some basic questions about your application.
Complete your basic questions with relevant details
The generation should now complete
You can now open you project in WebStorm
Just check your npm version to ensure you have he latest version , at the time this was 1.4.28
Now install the bower based dependencies into your project, you may need to install bower globally first.
npm install sudo npm install -g bower bower install
now you should be able to run grunt and start the website
Open your browser and navigate to http://localhost:3000 , you should see the default generated for you.
The guys over at meanjs.org have put together a great video tutorial explaining how to use mean.js. I recommend watching this, not only is it entertaining in a geek way, but it is also has some very useful tips!
Mean.js also has some really good documentation to read to get you up to speed. Check it out on http://meanjs.org/docs.html#overview
Have fun playing around with mean.js and please do let me know if you have any more questions or even if you have some additional tips, in the comment section below.
A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.