Can’t find the node binaryの解決法

Xcodeでビルドするときに、Can’t find the node binaryという

エラーが起きる。

これは、TARGET->アプリ名->Bundle ReactNative Code and Imageの

中のnodeのパスが正しくないために起きる。

上記のパスを見てみると

export NODE_BINARY=""
../node_modules/react-native/scripts/react-native-xcode.sh

やっぱりおかしかった!w空白て・・・。

そのままでは無論動かないので、TARGETに正しいnodeの場所を教えてあげる必要がある。

nodeのパスの正しい場所を確認するには、which nodeを使います。

コマンドでwhich nodeと入力
which node

結果がこちら
/Users/asaba/.nodebrew/current/bin/node

これをTARGET->アプリ名->Bundle ReactNative Code and Imageの

コード内に書き換える

export NODE_BINARY=/Users/asaba/.nodebrew/current/bin/node
../node_modules/react-native/scripts/react-native-xcode.sh

再度Xcodeでビルド。

>株式会社シーポイントラボ

株式会社シーポイントラボ

TEL:053-543-9889
営業時間:9:00~18:00(月〜金)
住所:〒432-8003
   静岡県浜松市中央区和地山3-1-7
   浜松イノベーションキューブ 315
※ご来社の際はインターホンで「316」をお呼びください

CTR IMG