Install MEAN development framework
Install MEAN development framework
The MEAN development framework is a package of solutions designed to streamline the development process and improve development efficiency. Components of the MEAN development framework (MongoDB, Express. js, Angular. js, Node. javascript) is described in Javascript, so it is called a full-stack development framework of Javascript development engineers. It may also be for this reason that I began to be attracted by it and gradually began to get familiar with it.
Before successfully running the MEAN framework page locally, I had a lot of detours. I will write down these points, which may be helpful to friends who encounter difficulties.
For more information about how to install MEAN, see http://learn.mean.io /. I successfully tested it on Ubuntu Kylin 15.05.
Pre: ensure that Node. js and MongoDB are installed in the system. An Introduction to MongoDB installation is provided in my other article. Here we will talk about how to install Node. js. With Ubuntu and apt, it becomes very simple. Just one sentence
Sudo apt-get install nodejs
Wait for the system to automatically download and install node. js from the Internet.
In addition, some npm files require source code extraction from github, so git also needs to be installed. Installing git on Ubuntu is equally simple:
Sudo apt-get install git
1. The MEAN framework is heavily dependent on npm. The full name of npm is node package manager, which is similar to apt but requires additional installation. Therefore, we must also use the sudo command to install it:
Sudo apt-get install npm
2. MEAN currently supports grunt and gulp. After reading the introduction, they are equivalent to ant or gradle I used to develop Android. The two tools must also be installed using npm. Install gulp:
Npm install-g gulp
Installation is also available
Npm install-g bower
3. You also need to install the mean command line interface. Therefore, you need to install mean-cli
Npm install-g mean-cli
4. Create your own project. I am here ~ Create a MEANProject folder under the folder, and then in the cd folder, start initialization using the mean command:
Mean init testApp
Wait for some time, because the template of the mean framework is to be downloaded from github.
Here, we will download many other libraries and package phantomjs-1.9.8-linux-x86_64.tar.bz2.
After the download, copy and paste it to the specified directory under the tmp directory.
In addition, it is best to create an account on the server side. Although I don't know how to create an account. To create an account, enter the name and email address. In short, you need to enter some information. The final success is as follows:
5. cd testApp & npm install
There may be various errors here, generally because git uses the https protocol to download files. If the file is too large, sometimes the https will be dropped, so the download fails, and the next step will have less arm and legs, very worried. Therefore, we must ensure that all components can be downloaded smoothly.
6. Finally, verify whether the MEAN framework can be started, and execute the following statement:
Gulp
Or
Node server
There are many errors here, and there are various situations, including
Failed to load c ++ bsonextension, using pure JS version
Such a problem (this problem does not seem to be obstacle)
Error: Cannot find module 'express-validator'
(This is also a difficult issue. I don't know how to solve it, but I have repeatedly installed the MEAN framework several times and finally solved it. I guess it should have been a problem that gulp was rarely installed in the past)
After a successful startup, it looks like this:
At this time, Type
Localhost: 3000
If you can see the MEAN webpage and the command prompt contains the words "get xxx", the MEAN is successfully started.
If you encounter any difficulties, you can leave a message to me after the blog. I will do my best to help solve the problem. Everyone is learning from each other. I always want to have friends who want to learn together, isn't it.