安装完 Node 后建议设置 npm 镜像以加速后面的过程(或使用科学上网工具)。
注意:不要使用 cnpm!cnpm 安装的模块路径比较奇怪,packager 不能正常识别!
输入下面两行命令使用镜像进行npm源的配置
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
配置后可通过下面方式来验证是否成功:
npm config get registry
出现下图表示镜像配置成功。