安装
npm i @vue/cli -g
(npm i vue -g 和 npm i vue-cli -g)
(npm i @vue/cli-service-global -g)
查看vue版本: vue -V
同时想要vue2和vue3:npm install -g @vue/cli-init
更新vue版本
- 先全局卸载vue-cli: npm uninstall vue-cli -g
- 重新下载:npm install vue-cli -g
vue2
创建项目:vue init webpack 项目名称;
运行 npm run dev ;
打包npm run build
vue3
创建项目:vue create 项目名称
运行 npm run serve
淘宝镜像
cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.org
或npm config set registry=http://registry.npm.taobao.org