React Native项目解决Xcode对真机编译报错:Can't find 'XX/node' binary to build React Native bundle

错误代码如下


React Native项目解决Xcode对真机编译报错:Can't find 'XX/node' binary to build React Native bundle_第1张图片
Paste_Image.png

解决方法是nodejs是从官网下载的tar包解压手动安装的,所以export NODE_BINARY=/Users/YYQ/node/node-v6.2.2-darwin-x64/bin/node是不行的,需要换成node的绝对路径:
打开终端执行下面代码

which node 

可以看见输出node的绝对路径(比如说我的是)

/usr/local/bin/node

按照下图替换掉node

React Native项目解决Xcode对真机编译报错:Can't find 'XX/node' binary to build React Native bundle_第2张图片
Paste_Image.png

你可能感兴趣的:(React Native项目解决Xcode对真机编译报错:Can't find 'XX/node' binary to build React Native bundle)