Vue as one of the three most popular front-end frameworks, I believe we have a good understanding of it, then we will talk about how to build the VUE development environment?

Install Node.js

Node.js must be downloaded before setting up the VUE environment. The operation of Vue depends on node NPM management tool to achieve, you can choose your own version to install according to your computer system

2. Install CNPM

After installing Node.js, open the command line tool and enter node -v to check whether Node.js is installed. If the node version is displayed, node.js is installed.

The next step is to install CNPM. Because NPM is very slow to use in China, we recommend using Taobao NPM image here. Using Taobao CNPM command management tool can replace the default NPM management tool: NPM install – g CNPM — registry=https://registry.npm.taobao.org;

Three, install vuE-CLI

With CNPM installed successfully, we can install vuE-CLI scaffolding tools globally.

Enter the command: CNPM install –global vue-cli press Enter;

Verify whether the installation is successful. Enter vue in the command, and the vUE information is displayed, indicating that the installation is successful.

At this point, the VUE is basically installed, and the next step is to create the VUE project

4. Create vUE project folder (when creating another VUE project folder, start from this step)

If you want to create the vUE project folder in the specified directory, first enter the command line tool into the specified folder (CD folder path).

Once in the folder, type vue init webpack vue-demo (vue-demo is the name of the folder, you can change it to your own project name), press Enter, press enter until it appears whether you want to install vue-Router

Vue-router is the plug-in we need for our project, so type y and press Enter

The following will appear whether we need JS syntax detection, which we do not need for the moment, you can directly enter no, the following can directly enter no, we do not need for the moment

Five, installation project dependence

The folder is now downloaded and ready to go to the folder (enter CD project file plus path in the command line tool). Since each template is interdependent, now we need to install the dependencies, then type CNPM install and press Enter

6. Run the project

With the dependencies installed, now to see if the project works properly, type NPM run dev and press Enter

8080 is the default port. To access this port, type localhost:8080 in your browser to open the default template.

So our VUE project is up and running, scatter flowers, finish.