Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
12
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@_mkazutaka

React-NativeをiOS実機でビルドしたら,node binaryが見つからないとエラーが出た件

備忘録です.

環境

  • Xcode 7.2.1
  • react-native-cli 0.1.10

エラー

React-NativeでInitしたプロジェクトに対し,OS実機を対象にビルドすると以下のnodeのエラーがでてきました.
PATH通ってるはずなのになと思いつつ解決方法を探ってみました

error: Can't find 'node' binary to build React Native bundle
If you have non-standard nodejs installation, select your project in Xcode,
find 'Build Phases' - 'Bundle React Native code and images'
and change NODE_BINARY to absolute path to your node executable
(you can find it by invoking 'which node' in the terminal)

解決方法

Projectファイルを選択 -> TARGETS -> APP Name -> Build Phases -> Bundle React Native code and image
にある以下のNODE_BINARY部分を変更します

export NODE_BINARY=node
../node_modules/react-native/packager/react-native-xcode.sh

homebrewを/opt以下にインストールしている場合,以下のようになります

export NODE_BINARY=/opt/homebrew/bin/node
../node_modules/react-native/packager/react-native-xcode.sh

mobileでアプリ名を作った時の画像です.
スクリーンショット 2016-02-19 16.11.30.png

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
12
Help us understand the problem. What are the problem?