Use scaffolding to build the Vue environment under Windows

Source: Internet
Author: User
Tags install node

Do a few months Vue project, the most recent two projects using scaffolding built, indeed with scaffolding to build a lot of convenience, think about the time before their own hand, is really ...

1. Before this I was the default you have used Vue, also by default you have installed node. js

2. Then install the global Vue-cli scaffold to help build the desired template frame

3. Command: CNPM install-g vue-cli, enter, wait for installation

After installation, you can enter Vue and then enter, if the Vue information appears, the installation is successful.

4. Then, you should create a project, find a suitable place for yourself, create a new project folder, name it according to your needs, my name is My-vue, then open this folder, right-click Git bash here, navigate to this folder, enter: Vue init webpack My-vue (project folder name), enter, wait a little while, followed by ' git ' items, you can press the operation:

At this point, the View My-vue folder under another Vue-test folder, this is the Vue project folder,:

5. After the command: CD vue-test into this folder, in the use of commands: cnpm Install, enter, wait a little while, back to the project folder, you will find the project structure, there is a Node_modules folder (the content of the file is the previous installation of dependencies).

6. Continue typing cnpm run dev at the command line to test if the environment is successful if it appears as stated:

Enter localhost:8080 in the browser to view the page as follows:

But,,,, as soon as it appeared but, there could be a bad situation, and I went to the last step when I ran cnpm run Dev, there was an error, similar information about the error message:

, it hints that NPM should be updated to 3.0.0 version, so I from the Internet various search how to update the version of NPM, about the issue of version update each has a statement and does not work, is still unsuccessful, finally found a way to install node before the same path, Re-download a latest version of node installation, this method is simple brute force. The reason is because I put node's configuration file registry into a domestic image, but a domestic image is not the latest version of synchronization, still maintained at 4.4.7, and many of its corresponding NPM installation package is not up-to-date, so the installation failed to find the latest version of some packages. So reinstalling is the best way to fix it. Once the reinstallation is complete, run CNPM run Dev again and it succeeds. At this point, my vue+webpack environment has finally been built.

Use scaffolding to build the Vue environment under Windows

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.