Problems encountered in Vue2. X construction

Vue – cli installation

Make sure the nodeJS environment is ok, preferably 10.x or later.

npm install -g vue-cli
Copy the code

Note that vuE-CLI based vUE 3.0 is installed using the following command

npm install -g @vue/cli
Copy the code

Vue-cli create project

vue init

Template-name Optional: webpack, webpack-simple, Browserify, Browserify -simple, pWA, simple. Webpack is usually selected

Note that the project name cannot be capitalized, otherwise an error will be reported

vue init webpack <project-name>
Copy the code

Unable to verify the first certificate

Cause: We used proxy server, so VUE-CLI failed to verify the certificate of proxy server when downloading webpack template, so this error was reported

Method 1: Disable SSL certificate verification. However, this method is not valid for everyone

npm config set npm_config_strict_ssl=false
Copy the code

Method 2: Use offline mode for vUE project initialization

  1. Kroon webpack-template project to the local C:\Users

    . Vue-templates folder

Download: github.com/vuejs-templ…

Windows using CMD. folder

mkdir .vue-templates
Copy the code
  1. Place the downloaded files in step 1 in the. Vue-templates /webpack folder

  2. Re-initialize the project offline with the vue command

vue init webpack <project-name> --offline
Copy the code

Other problems