1、设置全局安装路径,否则有可能会报错(错误为某某指令is not recognized as an internal or external command,operable program or batch file。——统一解决方法如下)
npm config set prefix "node路径/node_global" //设置全局包安装的地方
npm config set cache "node路径/node_cache" //设置node缓存保存的地方
2、安装vue,用命令行安装
首先利用淘宝镜像安装cnpm
npm install cnpm -g --registry=https://registry.npm.taobao.org
然后全局安装 vue-cli
cnpm install -g vue-cli
3、创建一个名为admin的vue框架,与server同级目录
vue create admin
4、安装ElementUI插件
vue add element
5、安装router
vue add router
6、启动admin
npm run serve //老版本启动命令为npm start,会报错npm ERR! missing script: devnpm ERR! A complete log of this run can be found in
7、浏览器访问http://localhost:3000