Getting started with Vue (2)-vuecli installation and project creation (resolving related issues)

1. Introduction to vuecli

Official website link: https://cli.vuejs.org/zh/guide/

2.vueCLI installation

(Prerequisite: Vue CLI requires  Node.js  8.9 or later (recommended 8.11.0+). You can check the official instructions)

Use the following command to install the new version

npm install -g @vue/cli
# OR
yarn global add @vue/cli

After the installation is complete, enter the command vue -V (note the capital V) or vue --version to view the vuecli version, version 4.2.3 has been installed here

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

In addition, the 4.2.3 version does not follow the success

Since the update of the new version modified the command, I started to install and type npm install -g vue-cli installed version 2.9.6

If you want to modify nodejs2.x to the advanced version, you need to uninstall the original version and then reinstall it. The command is:

npm uninstall -g vue-cli

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

3. Create the first Vue project

(I have some problems in the process of creation, which are also included)

1. Originally create a vue project using the command line, enter the following code on the command line:

vue create hello(hello为我创建的项目名称)

2. Select the appropriate option and then the next step (select according to your needs)

3. Start creating a project

If it is created normally, the following prompt will appear, indicating that the creation was successful:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

But at the beginning I got an error: the following is the error analysis, if the creation is successful, you can skip

(1) Solution reference link: https://blog.csdn.net/qq_35457469/article/details/102924524 (There are two methods, I tried the second method to clean directly with the command, enter it on the command line :)

npm cache clean --force

Then create it later, if successful.

(2) However, my problem has not been solved here, but a new error has occurred:

I tried as follows:

1.npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver  没有用

2. I thought it was a version issue, so I updated the npm version, and entering npm install -g npm @ latest is useless


3.npm cache clean --force clear npm cache

At this point finally has effect, re-create the first project, the creation is successful

Reference link: https://blog.csdn.net/genius_yym/article/details/84645915

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

4. Follow the prompts to enter commands to run the project

cd first 
npm run serve

Seeing the prompt indicates successful operation, and you can enter http: // localhost: 8080 / in the browser to  see the following interface, indicating that a vue project has been successfully created

Published 26 original articles · Likes6 · Visits 1400

Guess you like

Origin blog.csdn.net/Sabrina_cc/article/details/104805561