1.Chocolatey是一个 Windows 上的包管理器,类似于 linux 上的yum和 apt-get。
命令:@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

2.Python 2安装
打开命令提示符窗口,使用Chocolatey来安装 Python 2.
命令:choco install python2

3.安装NodeJS
打开命令提示符窗口,使用Chocolatey来安装 NodeJS。
命令:choco install nodejs.install

4.设置npm镜像
安装完node后建议设置 npm 镜像以加速后面的过程(或使用科学上网工具)。注意:不要使用 cnpm!cnpm 安装的模块路径比较奇怪,packager 不能正常识别!
命令:
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
注意:此时出现问题

解决办法:
找到nodejs文件路径,在环境变量将最后一个“/”去掉即可

5.Yarn、React Native 的命令行工具(react-native-cli)
Yarn是 Facebook 提供的替代 npm 的工具,可以加速 node 模块的下载。React Native 的。
命令行工具用于执行创建、初始化、更新项目、运行打包服务(packager)等任务。
命令:npm install -g yarn react-native-cli

6.安装完yarn后同理也要设置镜像源
命令:
yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global

网友评论