RN初始化后的iOS项目运行127错误,求指导



  • 具体错误如下(xcode7.2)

    • react-native bundle --entry-file index.ios.js --platform ios --dev true --bundle-output /Users/zhangchao/Library/Developer/Xcode/DerivedData/helloRN-fgsvkelxuqrffjapodbomsxamysu/Build/Products/Debug-iphonesimulator/helloRN.app/main.jsbundle --assets-dest /Users/zhangchao/Library/Developer/Xcode/DerivedData/helloRN-fgsvkelxuqrffjapodbomsxamysu/Build/Products/Debug-iphonesimulator/helloRN.app
      ../node_modules/react-native/packager/react-native-xcode.sh: line 49: react-native: command not found
      Command /bin/sh failed with exit code 127

    我已经在stack overflow 找到了暂时的解决方法:将.bash_profile中的代码复制到项目中node_modules/react-native/packager/react-native-xcode.sh 中,但是只是暂时的解决,新建一个项目还需要再次复制,好麻烦,有没有大神懂这个错误,求指导!


登录后回复