Environment Setup: Your Magical Workshop π§ββοΈπ§ β
Before we start waving our coding wands and summoning mobile apps, we need to set up our wizardβs workshop (aka your development environment). π° After all, even the greatest wizards canβt cast spells without their tools, right?
Letβs gather everything we need for our React Native adventure. π¦β¨
Step 1: Install Node.js π’ β
Node.js is like the Gandalf of JavaScript β wise, powerful, and slightly intimidating if you donβt know what it does. Donβt worry, though! This friendly wizard helps you run JavaScript on your machine. Without it, our magic (code) wonβt work. π§ββοΈ
- Go to Node.js Official Site
- Download the LTS (Long-Term Support) version β itβs the most stable spellbook. Trust us, you donβt want to mess with experimental spells. π
# Download and install fnm:
winget install Schniz.fnm
# Download and install Node.js:
fnm install 22
# Verify the Node.js version:
node -v # Should print "v22.14.0".
# Verify npm version:
npm -v # Should print "10.9.2".
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js:
nvm install 22
# Verify the Node.js version:
node -v # Should print "v22.14.0".
nvm current # Should print "v22.14.0".
# Verify npm version:
npm -v # Should print "10.9.2".
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js:
nvm install 22
# Verify the Node.js version:
node -v # Should print "v22.14.0".
nvm current # Should print "v22.14.0".
# Verify npm version:
npm -v # Should print "10.9.2".
Step 3: Install watchman π β
Watchman is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
Install it from here: Watchman
# Download and extract the windows release from the latest release
# It will be named something like watchman-vYYYY.MM.DD.00-windows.zip
# It contains a bin folder. Move that somewhere appropriate and update your PATH environment to reference that location.
# Installing via Chocolatey
PS C:\> choco install watchman
# Download the latest release:
# https://github.com/facebook/watchman/releases/
# It will be named something like watchman-vYYYY.MM.DD.00-linux.zip
# use the below command to install it
unzip watchman-*-linux.zip
cd watchman-vYYYY.MM.DD.00-linux
sudo mkdir -p /usr/local/{bin,lib} /usr/local/var/run/watchman
sudo cp bin/* /usr/local/bin
sudo cp lib/* /usr/local/lib
sudo chmod 755 /usr/local/bin/watchman
sudo chmod 2777 /usr/local/var/run/watchman
brew update
brew install watchman.
# If for some reason you can't wait for the Homebrew package to update, you can install the latest build from GitHub:
brew install --HEAD watchman
Step 2: Get a Code Editor π β
Every wizard needs a spellbook to write down their magical incantations, and for us, thatβs a code editor. We highly recommend VS Code because itβs like a cozy library where everything smells like books and possibility. π
- Download it here: Visual Studio Code
- Install any cool extensions you like (optional). Weβre not picky wizards here.
Step 3: Install Android/iOS Simulators π± β
Now, letβs get some simulators. This is where your app will come to life before it flies off to real devices! π¦
- For Android users, youβll need to install Android Studio β think of it as your Android summoning circle. π€
- For iOS users (macOS only), youβll use Xcode. Yes, itβs heavy, but this is where the iOS magic happens! π
You can follow the link to - Install Simulators