React Nativeの環境構築

未分類

ともかくReact Nativeをインストールしてみる。

React Nativeのインストール

さて、コマンド実行してみる。

参照:React Native 環境構築 macOS 10.13.3@Qiita

404 Not Found - Qiita - Qiita

$ brew install node
-bash: brew: command not found

はいってないじゃん!

参照:Homebrew

Page not found · GitHub Pages

ここ参照しながら以下のコマンドを実行。

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)

このあと管理者権限聞かれたりしながら、「Command Line Tools (macOS High Sierra version 10.13) for Xcode」ってやつも入れられながら待つ。

待つ。

すげー待つ。ネットが遅いから。

Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
remote: Enumerating objects: 694497, done.
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
Failed during: /usr/local/bin/brew update –force
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations

==> Next steps:
– Run `brew help` to get started
– Further documentation:
https://docs.brew.sh

エラーじゃん!

参照:git clone時にbufferが足りなくてエラーになった話@whatex様

お探しのページは見つかりませんでした。 - はてなブログ

なんかバッファが足りないらしいよ。16Mにしてみよう。

git config –global postBuffer 16M

で再チャレンジ。→ダメ

でも、結局brewインストールは成功してるって言ってるから、気持ち悪いけど、改めて以下を実行してみる。

brew install node

あ、成功したっぽい。

==> Installing dependencies for node: icu4c
==> Installing node dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-64.2.high_sierra.bott
==> Downloading from https://akamai.bintray.com/02/02afdd6a472c31351e46a3b2a38c1
######################################################################## 100.0%
==> Pouring icu4c-64.2.high_sierra.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
echo ‘export PATH=”/usr/local/opt/icu4c/bin:$PATH”‘ >> ~/.bash_profile
echo ‘export PATH=”/usr/local/opt/icu4c/sbin:$PATH”‘ >> ~/.bash_profile

For compilers to find icu4c you may need to set:
export LDFLAGS=”-L/usr/local/opt/icu4c/lib”
export CPPFLAGS=”-I/usr/local/opt/icu4c/include”

==> Summary
🍺 /usr/local/Cellar/icu4c/64.2: 257 files, 69.5MB
==> Installing node
==> Downloading https://homebrew.bintray.com/bottles/node-13.11.0.high_sierra.bo
==> Downloading from https://akamai.bintray.com/27/27ece592611f84f56af9e4cf14308
######################################################################## 100.0%
==> Pouring node-13.11.0.high_sierra.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/node/13.11.0: 4,686 files, 60.2MB
==> Caveats
==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
echo ‘export PATH=”/usr/local/opt/icu4c/bin:$PATH”‘ >> ~/.bash_profile
echo ‘export PATH=”/usr/local/opt/icu4c/sbin:$PATH”‘ >> ~/.bash_profile

For compilers to find icu4c you may need to set:
export LDFLAGS=”-L/usr/local/opt/icu4c/lib”
export CPPFLAGS=”-I/usr/local/opt/icu4c/include”

==> node
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

なんでビール出るん……。でも大丈夫ぽい。

次に以下を実行。

brew install watchman

あ、成功した。

React Native CLIのインストール

以下を実行する。

npm install -g react-native-cli

どうかな。

+ react-native-cli@2.0.1
added 72 packages from 25 contributors in 6.918s

お、いいかんじ。

react-native-cli: 2.0.1 がインストールされたらしい。

XcodeとXcode Command Line Tools

も入れてみる。App Storeからダウンロード。

Xcodeは“APPLE SSD SM128C Media”にはインストールできません。macOSバージョン10.14.4以降が必要です。

おーい、ダメじゃん!俺MacBook Airが、世界に取り残されている現実に泣いた。

諦めきれないので、以下の記事を読んだ。

参考:macOS High SierraにXCode 10.1をインストール(備忘録)@Qiita, kizitorashiro様

macOS High SierraにXCode 10.1をインストール(備忘録) - Qiita
macOS High SierraにXCodeをインストールする。XCode 10.1のインストール2020年1月時点で最新のXCode11はインストールできない。XCode10.1をAppSt…

いけた!けど、5.6GBあるからダウンロード開始。

早く来ないかなー。