1. Set the default warehouse of npm to the domestic Taobao mirror, 2 methods:
① Method 1:
npm config set registry https://registry.npm.taobao.org
After execution, confirm whether the setting is successful: npm config get registry
If you see the return to Taobao mirror image, it means success!
② Method 2: Alternatives
npm i -g cnpm --registry=https://registry.npm.taobao.org
Confirm whether the installation is successful: cnpm -v
Seeing the version number indicates success!
2. Use npm or cnpm to install a command-line tool that repeatedly generates scaffolding projects:
//用 npm 安装:
npm i -g @vue/cli
// 如果说 FEXIST 错误,也可以换成
npm i -g @vue/cil --force
//如果 npm 出错,可换成:
cnpm i -g @vue/cli
3. Verify that vue/cli is installed successfully: vue-V
Seeing the version number indicates that the installation was successful!
4. Emphasis: on a computer, no matter how many projects will be done in the future, vue/cli only needs to be installed once when it is used for the first time!
5. Create a vue project:
①Find the folder location of the project to be created, vue create custom project name;
② Enter vue ui on the command line to create a Vue project visually;