1. 先下载 联想电脑管家,在 联想电脑 里面下载 BandiZip 和 Git
2. 下载 node.js ,检测是否安装成功 node -v 和 npm -v
3. 安装 cnpm 切换为淘宝镜像源 npm install -g cnpm --registry=https://registry.npm.taobao.org 检测 cnpm -v
问题: 如果 cnpm -v 时出现错误了,则执行下面5步
1、在系统搜索框中 输入 Windos PowerShell
2、点击“管理员身份运行”
3、输入“ set-ExecutionPolicy RemoteSigned”回车
4、之后输入A,回车
5、再次回到项目中执行cnpm -v,执行成功。
4. 切换为淘宝镜像源代码 如下
npm config set registry https://registry.npm.taobao.org
npm config get registry
4.1 将 cnpm 的镜像源地址切换到 淘宝地址
cnpm config set registry https://registry.npm.taobao.org
cnpm config get registry
5. 下载安装 yarn
npm install -g yarn
注意: 这时有可能会报错
image
</br>
解决方法: 用 管理员运行 窗口命令
image
</br>
6. yarn 切换为淘宝镜像源
yarn config set registry https://registry.npm.taobao.org/
查看当前源
yarn config get registry