Last active
April 21, 2017 03:42
-
-
Save kosiara/137f7fb453061879d71b to your computer and use it in GitHub Desktop.
Setup Facebook React-native sample (empty) project on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# author: | |
# @Bartosz Kosarzycki | |
# | |
sudo apt-get install npm | |
sudo npm install -g react-native-cli | |
sudo ln -s /usr/bin/nodejs /usr/bin/node | |
cd /home/user/your/project/path | |
react-native init AwesomeProject | |
cd AwesomeProject | |
react-native run-android | |
==================== if something goes wrong: ============================== | |
check node.js version | |
> node --version | |
v0.10.25 | |
if it's below 0.12 upgrade your node.js: | |
sudo apt-get install -y curl | |
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - | |
sudo apt-get install -y nodejs | |
> node --version | |
v0.12.7 | |
================================================= | |
Check your adb version: | |
adb version | |
Android Debug Bridge version 1.0.31 | |
if it's below 1.0.32 upgrade your adb tools | |
> adb version | |
Android Debug Bridge version 1.0.32 | |
Revision 09a0d98bebce-android | |
====== "Unable to download JS bundle" =========================================== | |
# | |
# In order to run the Facebook react app you need to start the JS server on the PC and forward port 8081 to the phone | |
# | |
> sudo react-native start | |
(or | |
> sudo react-native start > /dev/null 2>&1 & | |
to start in the background) | |
> adb reverse tcp:8081 tcp:8081 | |
(Note that this option is available on devices running android 5.0+ (API 21).!!!) | |
Hi @kosiara
Nice tutorial. I got node v5.0.0
and nodejs v0.10.25
, that is correct? ❓
wakematta@wm-pc:~/github/testApp$ node --version
v5.0.0
wakematta@wm-pc:~/github/testApp$ nodejs -v
v0.10.25
Any help on how to debug react native apps using chrome on Ubuntu? I have a pretty old question at Stackoverflow without a solution still. Can you help me with this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@phlegx
Exactly, I always install all available extras
from Android SDK Manager. That's probably why I have not stumbled on that error.
Thanks for the tip!