Preparing the Environment
- node.js
- view-cli
Installation configuration environment
1. Download node.js, using the default configuration installation.
2. Use the command to install domestic npm download the image (optional)
cmd: npm install -g cnpm --registry=https://registry.npm.taobao.org
tips: Check or cnpm version npm npm -v at the command line or cnpm -v
3. Installation global cli-VUE (v ue-built project cli3.x interface more concise view vue-cli 3.x new features )
cmd: cnpm(或 npm) install vue-cli -g
tips: In the command line input vue -V View vue-cli version ( note capital -V here must be the 'V' )
Create a project
1. Create a project vue
(VUE-cli v2.x ) cmd: VUE the init WebPACK "Project Name"
(VUE-cli v3.x ) cmd: VUE the Create "Project Name"
2. Installation depends
cmd: cd to the project root directory, execute the command npm install
3. Run Project
(vue-cli v2.x)cmd: npm run dev 或 npm start
(vue-cli v3.x)cmd: npm run serve
? What is the npm and cnpm
npm (node package manager): nodejs package management for plug-in management node (including installing, uninstalling, management dependence)
cnpm: Because npm install the plug-in is downloaded from the server abroad, the affected network is relatively large, an exception may occur, if the server npm like in China, so we are happy to share Taobao team did this thing. From the official website: "This is a complete npmjs.org image, you can use this instead of the official version (read-only), synchronous frequency of the current 10 minutes to ensure as far as possible be synchronized with the official service."
Further reading :