0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MacでReactNativeの環境構築

Last updated at Posted at 2018-08-25

手順

公式のGetting Startedに、エラー対処なども含めて詳しく記載されていました。

Node, Watchmanのインストール

$ brew install node
$ brew install watchman

Watchmanのインストール時のエラー

Watchmenのインストール時に下記エラーが発生しました。
手動でディレクトリを作成することで回避しました。
ユーザー名はwhoamiで読み替えてください。

# エラー内容
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

# 回避方法
$ sudo mkdir /usr/local/Frameworks
$ sudo chown your_user:admin /usr/local/Frameworks/

react-native-cliのインストール

$ npm install -g react-native-cli

サンプルプロジェクトの作成

$ react-native init SampleProject
$ cd SampleProject/

iOSのエミュレーターで確認

$ react-native run-ios

Androidのエミュレーターで確認

SDKのバージョンが古かったため、アップデートを行いました。

$ react-native run-android
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?