windows配置react native环境
来源:互联网 发布:java单例模式调用 编辑:程序博客网 时间:2024/05/18 19:43
参考http://reactnative.cn/docs/0.43/getting-started.html
1,打开lantern
2,安装Chocolatey
以管理员身份运行cmd.exe,键入
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Chocolatey正常安装成功
3,安装python2
windows自带2.7,不需要安装
choco install python2
4,安装Node.js
choco install nodejs.install
nodejs.install package files install completed. Performing other installation st
eps.
The package nodejs.install wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[N]o/[P]rint): y(点击yes)
配置nodejs环境变量,将nodejs安装目录配置到全局环境变量中,windows默认为C:\Program Files\nodejs
安装完node后建议设置npm镜像以加速后面的过程(或使用科学上网工具)
npm config set registry https://registry.npm.taobao.org --globalnpm config set disturl https://npm.taobao.org/dist --global
5,Yarn、React Native的命令行工具(react-native-cli)#
Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载。React Native的命令行工具用于执行创建、初始化、更新项目、运行打包服务(packager)等任务。
npm install -g yarn react-native-cli
安装完yarn后同理也要设置镜像源:
yarn config set registry https://registry.npm.taobao.org --globalyarn config set disturl https://npm.taobao.org/dist --global
6,安装完node后建议设置npm镜像以加速后面的过程(或使用科学上网工具)
npm config set registry https://registry.npm.taobao.org --globalnpm config set disturl https://npm.taobao.org/dist --global
Gradle Daemon
开启Gradle Daemon可以极大地提升java代码的增量编译速度。
(if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") && (echo org.gradle.daemon=true >> "%USERPROFILE%/.gradle/gradle.properties")
将Android SDK的Tools目录添加到PATH
变量中
你可以把Android SDK的tools和platform-tools目录添加到PATH
变量中,以便在终端中运行一些Android工具,例如android avd
或是adb logcat
等。
打开控制面板
-> 系统和安全
-> 系统
-> 高级系统设置
-> 高级
-> 环境变量
-> 选中PATH
-> 双击进行编辑
7,将sdk目录添加入ANDROID_HOME环境变量
8,键入命令react-native init hello
cd hello
react-native run-android
应用正常在联想测试机打开,配置完成
安装完node后建议设置npm镜像以加速后面的过程(或使用科学上网工具)
npm config set registry https://registry.npm.taobao.org --globalnpm config set disturl https://npm.taobao.org/dist --global
5,Yarn、React Native的命令行工具(react-native-cli)#
Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载。React Native的命令行工具用于执行创建、初始化、更新项目、运行打包服务(packager)等任务。
npm install -g yarn react-native-cli
安装完yarn后同理也要设置镜像源:
yarn config set registry https://registry.npm.taobao.org --globalyarn config set disturl https://npm.taobao.org/dist --global
- React Native环境配置(Windows)
- windows配置react native环境
- windows 下配置 react native 开发环境
- Windows搭建安装React Native环境配置
- windows下配置React Native开发环境
- React native 开发环境配置 for windows
- React Native环境配置(android,windows)
- Windows下React-Native开发环境配置
- windows下react-native环境配置
- React Native 配置windows下 IDE环境
- React Native 环境配置
- React Native环境配置
- React-Native环境配置
- React Native 环境配置
- React Native 环境配置
- React Native环境配置
- react native 环境配置
- React Native 环境配置
- keil 简介
- Vector的实现
- Sendmail邮件服务器搭建与配置笔记
- 常用的jvm参数
- 【树形结构】洛谷 P1030 求先序排列
- windows配置react native环境
- ACM对拍程序
- Java框架:Spring原理与环境搭建
- 【贪心】洛谷 P1031 均分纸牌
- 打开debug模式下的打印窗口output
- 【模拟】洛谷 P1035 级数求和
- Oracle12.2 多租户环境下的授权管理
- 线程同步synchronized
- JavaScript eval定义动态变量名及赋值教程