1.npm设置镜像和安装cnpm
C:\Users\Administrator>npm get registry
https://registry.npmjs.org/
- 输入npm config set registry xxx(镜像源地址)。
C:\Users\Administrator>npm config set registry https://registry.npm.taobao.org
- 查看当前镜像源,设置成功
C:\Users\Administrator>npm get registry
https://registry.npm.taobao.org/
- 安装cnpm
npm install -g cnpm
2.安装CLI脚手架
cnpm install -g @vue/cli
vue -V
@vue/cli 5.0.8
3.安装yarn
cnpm i yarn -g
yarn -V
yarn install v1.22.19
warning package.json: No license field
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.06s
4.创建项目
vue create shop
选择手动安装
选择要安装的选项
安装成功目录如下
使用命令:
npm run serve/yarn serve
运行项目: