Detailed Description: Vue uses the command line to build a single page application, and detailed description of vue command line construction

Source: Internet
Author: User

Detailed Description: Vue uses the command line to build a single page application, and detailed description of vue command line construction

Use command lines to build a single page application

Let's take a look at the final result:

Outline

1. Download node, git, npm

2. Use command line to install a project

1. Download Tool

You can download node and git on the official website.

The following describes how to install npm. npm is only available when both of the above are installed.

Domestic direct git npm is very slow, so we will download and install the image address under the taobao npm image>

Open the installed git bash

1. Enter the image address in Git Bash:

After the download is successful, enter cnpm-v to check whether the installation is successful.

2. After npm is installed, go back to the official Vue website and use the command line to install npm.

Follow the steps above to install: (if npm is used, change it to cnpm)

1. Global installation of vue-cli $ cnpm install-g vue-cli

2. Create a "webpack"-based template project $ vue init webpack my-pro

There will be a series of problems:

3. Install the dependency $ cd my-pro and switch to the my-pro directory you just created.

4. Enter $ cnpm install to download the dependent node_module module. You can see that the node dependency module has been downloaded under the directory.

5. Finally, enter cnpm run dev.

Since a project was created at the beginning and port 8080 of node was occupied, the following error is reported,

A simple and crude method is to close the current node process:

The most, the most, and the last step:

Next let's open http: // localhost: 8080. Finally, it succeeded !!!

PS: record some commands

1. $ cnpm install -- global vue-cli

2. $ vue init webpack-simple demo

3. $ cd demo/

4. $ cnpm install

5. $ npm run dev

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.