The solution to the installation of vue scaffolding has been stuck

1. Turn off the firewall and other software to avoid interception and inability to use the npm installation package

2. Use Taobao mirror

Next, download a cnpm (Note: Taobao npm mirror, this is Ali moved the foreign npm server to China, it will be faster to download some configuration files with Taobao mirror npm)

Cmd right click to copy the following command:

npm install -g cnpm --registry=https://registry.npm.taobao.org

Insert picture description here

3. Install the vue file

cnpm install vue 

4. Install vue scaffolding, regarding scaffolding issues,

Some brothers and sisters will find that they will stay stuck during installation. I have also encountered this problem. Finally, I checked the information and found that the version of vue scaffolding I installed was relatively low. The problem
must be remembered to install the latest version of vue scaffolding. , The latest version is as follows:

cnpm install -g @vue/cli
cnpm install -g @vue/cli-init

After installing the above 2 vue scaffolding configuration files, enter:

vue init webpack myproject  

//When configuring, except for use ESlint to lint your code to select n, all others are to select y, because use ESlint to lint your code will be stricter when we write code, for example, the code must have the same spaces...

When the installation is complete, enter npm run dev
after the completion of the operation will give us a URL http//localhost:8000

5. Some vue scaffolding directories that need to be understood

  • build is the webpack configuration file
  • config core file
  • Src stores resources, assets stores static resources such as pictures
  • router is routing

Guess you like

Origin blog.csdn.net/u013034585/article/details/106763710