Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

備忘録です.

環境

  • 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

_mkazutaka
CI/CD Webが好きなエンジニア バックエンドからフロントまで広めにやってます
mercari
フリマアプリ「メルカリ」を、グローバルで開発しています。
https://tech.mercari.com/
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした