LoginSignup
11

More than 5 years have passed since last update.

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

Last updated at Posted at 2016-02-19

備忘録です.

環境

  • 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

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
11