使用react-native init <projectName>
,然后npm install
导致构建失败并显示错误:
Command /bin/sh failed with exit code 127
和消息:
../node_modules/react-native/packager/react-native-xcode.sh: line 36: react-native: command not found
Command /bin/sh failed with exit code 127
已在本地安装react-native,并且全局无效。
是否有人遇到此问题并知道如何解决?
答案 0 :(得分:0)
这里解释的黑客有效: https://github.com/facebook/react-native/issues/3948
添加source ~/.bash_profile
到react-native-xcode.sh
显然已修复0.16.0-rc
!
https://github.com/facebook/react-native/commit/9a64f17de84e50a4fc60f1b96168aa61925934a8