react-native: Command /bin/sh failed with exit code 127
(Using Node version v4.2.1)
This is the terminal window when I click on build inside of XCode:
/Users/bla/Documents/ios-apps/emesgee/node_modules/react-native/local-cli/cli.js:56
const setupEnvScript = /^win/.test(process.platform)
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
Process terminated. Press <enter> to close the window
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 52 (8 by maintainers)
Temporary workaround (to at least get React Native working):
cd
into [your app]/node_modules/react-native/packager./packager.sh
(for some reason this runs fine)Now hit build in XCode. Since the shell script is no longer part of the XCode build routine, it shouldn’t fail. And if you have the react native client server running in another terminal window, then everything should run fine.