MEAN is a framework for an easy starting point with MongoDB, Node.js, Express, and AngularJS based applications. It is designed to give you a quick and organized way to start developing MEAN based web apps with useful modules like Mongoose and Passport pre-bundled and configured. We mainly try to take care of the connection points between existing popular frameworks and solve common integration problems.
- Mean currently uses gulp as a build tool and bower to manage frontend packages.
$ npm install -g gulp
// and bower
$ npm install -g bower
To start with MEAN install the mean-cli
package from NPM.
This will add the mean command which lets you interact (install, manage, update ...) your Mean based application.
$ npm install -g mean-cli
$ mean init <myApp>
$ cd <myApp> && npm install
Mean supports the gulp task runner for various services which are applied on the code. To start your application run -
$ gulp
Alternatively, when not using gulp
(and for production environments) you can run:
$ node server
Then, open a browser and go to:
http://localhost:3000
If you have a rails, node, or other mean project already running, you may need to use a different port. You can set the port and start your new mean project with one command:
$ export PORT=3001 && gulp
Then, open a browser and change the port number before you visit:
http://localhost:3001
During installation depending on your os and prerequisite versions you may encounter some issues.
Most issues can be solved by one of the following tips, but if you are unable to find a solution feel free to contact us via the repository issue tracker or the links provided below.
Sometimes you may find there is a weird error during install like npm's Error: ENOENT. Usually updating those tools to the latest version solves the issue.
- Updating NPM:
$ npm update -g npm
- Updating Gulp:
$ npm update -g gulp
- Updating Bower:
$ npm update -g bower
NPM and Bower has a caching system for holding packages that you already installed. We found that often cleaning the cache solves some troubles this system creates.
- NPM Clean Cache:
$ npm cache clean
- Bower Clean Cache:
$ bower cache clean