一直是从事iOS的开发,现在研究下mac环境下reatNative的环境配置:

1. 安装HomeBlew(OS系统上的一个安装包管理器,安装后可以方便后续安装包的安装。)

终端命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


2. 安装Node.js (服务端的JavaScript运行环境)

下载地址:https://nodejs.org/download/

成功安装后,终端会有如下提示信息:

Node.js was installed at: /usr/local/bin/node

npm was installed at: /usr/local/bin/npm

Make sure that /usr/local/bin is in your $PATH.

3. 建议安装WatchMan(React修改source文件的一个工具)

终端命令:

brew install watchman

4. 安装Flow: 一个JavaScript 的静态类型检查器。

终端命令:

brew install flow

5. 安装React Native CLI: 用来开发React Native的命令行工具

终端命令:

npm install -g react-native

创建项目1. 新建一个项目

  新建一个“HelloWorld”的项目,每个语言的开始教程都是这个,我们也不例外。

操作超级简单,只需终端输入命令行:

react-native init HelloWorld

这样就新建了一个工程,前往文件夹:/用户/xxx/HelloWorld (xxx为电脑用户名),打开iOS文件下的工程:

注意:打开后会报以下错误

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc'▸ Compiling fast-dtoa.cc

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc'▸ Compiling fixed-dtoa.cc

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc'▸ Compilingdouble-conversion.cc

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc'▸ Compiling diy-fp.cc

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/diy-fp.cc'▸ Compiling cached-powers.cc

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/cached-powers.cc'▸ Compiling bignum.cc

❌ error: Build input file cannot be found:'/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/bignum.cc'

解决方案

cd node_modules/react-native/scripts && ./ios-install-third-party.sh &&cd../../../

cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh

ReactNative 环境配置的更多相关文章

  1. react-native 环境配置及hello world

    一.前言 最近手头的工作繁多,有研究性的项目和系统研发,正好遇到同事离职,接手了框架的UI组件,不仅需要维护和填坑,还需要开发新的功能组件.因为身在H5-Hybird的框架部门,最近团队开始尝试使用R ...

  2. react-native环境配置入坑指南.

    官方入门教程:https://reactnative.cn/docs/0.51/getting-started.html http://services.gradle.org/distribution ...

  3. ReactNative环境配置

    参考链接 Windows系统安装React Native环境 windows下React Native Android 环境搭建 在Windows下搭建React Native Android开发环境 ...

  4. ReactNative环境配置的坑

    我用的是windows开发android,mac的可以绕道了. 1.android studio及Android SDK的安装 现在需要的Android版本及对应的tool 2.真机运行要配置对and ...

  5. React-native 环境配置及项目创建

    https://reactnative.cn/docs/next/getting-started.html 看到  安装 Android Studio 安装 Android Studio http:/ ...

  6. mac上配置react-native环境run-ios/run-android命令遇到的问题

    新报错(rn版本:0.53.3)2018.3.6 今天在搞react-native环境时,遇到了一些坑,这里记录一下. 首先最重要的一点是一定要按官网一步一步来,不然可能会出现一些奇奇怪怪的问题! 官 ...

  7. React-Native 之 环境配置和简单使用

    # 前言 学习本系列内容需要具备一定 HTML 开发基础,没有基础的朋友可以先转至 HTML快速入门(一) 学习 本人接触 React Native 时间并不是特别长,所以对其中的内容和性质了解可能会 ...

  8. (二)react-native开发系列之windows开发环境配置

    之前写了react-native在mac上得环境搭建,但是如果只开发android的话,只要用windows系统就可以了,下面就来说下react-native的windows开发环境配置. 1.下载配 ...

  9. (一)react-native开发系列之Mac开发环境配置

    写在前面 在开始之前,先说下选择react-native的背景原因 最近一年来,公司为了节省开发成本,以及降低维护成本,指派我开始做起前端开发app的工作,我和公司的小伙伴们就开始了漫长的app开发之 ...

随机推荐

  1. day7—直播内容(元昊老师著)

    *******************************class animal(object): def __init__(self): self.is_handsome=True def e ...

  2. 浅谈Socket长连+多线程

    缘由 不知各位同仁有没有发现,用简单,无外乎就是都是一个流程 1)监听链接 2)校验链接是否是正常链接 3)保存链接至全局静态字典 4)开启新线程监听监听到的线程报文 5)执行对应命令或者发送对应命令 ...

  3. cocos2d-x游戏引擎核心之十——网络通信

    一.建立基本的http通信并得到返回信息 1.创建cocos2dx工程 2.项目引用外部库 如果要使用cocos2dx的CCHttpClient来进行网络访问,则需要引入cocos2dx的相关库,详细 ...

  4. block基本使用和底层

    block基础使用语法   一.block与函数的对比 定义函数指针 int (*myFn)(); 定义Blocks int (^MyBlocks)(int,int); 调用函数指针 (*myFn)( ...

  5. 【转】Go Channels

    转自: http://kdf5000.com/2017/07/16/Go-Channels/ Golang使用Groutine和channels实现了CSP(Communicating Sequent ...

  6. AndroidWear开发之开发环境[前奏]

    上篇教程教的是如何下载最新的SDK http://www.cnblogs.com/bvin/p/3811751.html 一.Eclipse下的尝试 之前以为在Eclipse下把SDK,ADT更新一下 ...

  7. poj_2315 最小费用最大流

    题目大意 一个图上有N个顶点,从1到N标号,顶点之间存在一些无向边,边有长度,要求从顶点1走到顶点N,再从顶点N走回顶点1,其中不必要经过每个顶点,但是要求走的路径上的边只能经过一次.求出从1---& ...

  8. LeetCode——Convert Sorted Array to Binary Search Tree

    Description: Given an array where elements are sorted in ascending order, convert it to a height bal ...

  9. 高中生的IT之路-1.1自序

        近几年来越来越多的人问我关于 高中生要不要读大学.大学选择专业.毕业后的择业问题,索性我不如把我对这几方面的理解写出来,如果有幸能帮助到更多的人,那也算是个人对社会做出了一点贡献.       ...

  10. 【BZOJ2815】[ZJOI2012]灾难 拓扑排序+LCA

    [BZOJ2815][ZJOI2012]灾难 题目描述 阿米巴是小强的好朋友. 阿米巴和小强在草原上捉蚂蚱.小强突然想,果蚂蚱被他们捉灭绝了,那么吃蚂蚱的小鸟就会饿死,而捕食小鸟的猛禽也会跟着灭绝,从 ...