搭建ReactNative开源应用f8app环境与踩坑

f8app是facebook官方开发的ReactNative开源APP,github地址https://github.com/fbsamples/f8app,github地址中有详细的搭建步骤,但是坑太多,这里记录下。

一.基础环境 Requirements

我这里使用的是Mac OS
1.React Native (follow iOS and Android guides)
http://reactnative.cn/docs/0.45/getting-started.html有详细的环境搭建。
2.Xcode 7.3 + (运行的是Android暂时忽略)
3.CocoaPods (only for iOS) (运行的是Android暂时忽略)
Version 1.0+ recommended (gem install cocoapods –pre)
4.MongoDB (needed to run Parse Server locally)

brew install mongodb

二.安装(有修改)

Clone the repo

$ git clone https://github.com/fbsamples/f8app.git
$ cd f8app

Install dependencies (npm v3+):

$ npm install
$ (cd ios; pod install)        # only for iOS version

Import sample data

npm run import-data 这条命令运行会百分百报错SyntaxError: Unexpected token P in JSON at position 0
是由于facebook的PaserServer已经关闭了,不能连接了,这里我们下载一个备份的数据库文件
下载 https://github.com/ReactWindows/f8app/blob/data/mongodb/db.zip
然后解压文件到任意目录,例如~/data/f8dp
然后运行以下命令加载数据库文件
mongod –storageEngine wiredTiger –dbpath ~/data/f8dp

Make sure MongoDB is running:

$ lsof -iTCP:27017 -sTCP:LISTEN

显示如下信息,证明数据库运行起来了

COMMAND   PID       USER   FD   TYPE 
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值