快速配置Vue环境
在安装vue前首先要有准备工作,要安装node 及 npm (自带的)
【Node.js官方安装包及源码下载地址:http://nodejs.org/download/】

安装Vue:
vue 2.x版本:

npm install -global vue-cli
cd ****你想存入的文件夹
vue init webpack my-project
npm run dev      

安装vue 3.x版本:

npm install -g @vue/cli
cd ***文件夹
vue create my-project
npm run serve

如果你安装了2.x版本的Vue,安装3.x版本的Vue会报错:

npm ERR! Unexpected end of JSON input while parsing near '...QMc6vc5BL6/+lT/ihMjyr'
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-09-13T11_56_28_103Z-debug.log

这时需要卸载2.x版本的Vue:

npm uninstall vue-cli -g
npm cache clean --force       //强制清理缓存,这一步很重要,不然安装不了