vue-cli2.x and vue-cli3.x building steps

1. Install node.js

2. Install webpack

  • Install webpack globally:npm install webpack -g
  • At the same time, you need to install webpack-cli, runcnpm install webpack-cli -g
  • Check the webpack version:webpack -v

3. Install vue-cli 2.x

  • runnpm install vue-cli -g

  • If the previous step has been installed for a long time, or the installation fails, switch to the Taobao image first npm install -g cnpm --registry=https://registry.npm.taobao.org, and then execute the installation commandcnpm install vue-cli -g

  • Create project:vue init webpack 项目名(不要取中文)insert image description here

  • Verify that the installation was successful:vue -V

4. Install vue-cli 3.x

  • Install the latest version:cnpm install @vue/cli -g
  • Install the specified version:cnpm install @vue/[email protected] -g
  • Create project:vue create 项目名(不要取中文)
    insert image description here
  • Run the project:cnpm run serve

Guess you like

Origin blog.csdn.net/qq_37344867/article/details/125874834