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
Same issue here.
Same here ... happy to help with any diagnostics. I am using react-native-cli 0.1.7 and Node v5.0.0
I thought I'd have a quick try at just commenting out the 'use strict;' in cli.js to see if that would fix it.
But then I get:
/Users/adam/Documents/code/AwesomeProject/node_modules/react-native/local-cli/cli.js:104
class CreateSuppressingTerminalAdapter extends TerminalAdapter {
^^^^^
SyntaxError: Unexpected reserved word
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:906:3
Process terminated. Press <enter> to close the window
+1
+1
Temporary workaround (to at least get React Native working):
- Use node version v4.2.1
cdinto [your app]/node_modules/react-native/packager- Run
./packager.sh(for some reason this runs fine) - Go into XCode and go to the Build Phases tab.
- Remove the last item on the list (the one that runs the script). So you're left with Target Dependencies, Compile Sources, Link Binary With Libraries, and Copy Bundle Resources.
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.
Thanks @shahzeb1, that solved my problem.
+1
Thats greate but all you need to do is just delete the last Item in Build Phase in Xcode perfect not a work around dont need to cd into anything after that
~~Running react-native upgrade fixed this for me.~~
Update: Sorry, turns out this didn't fix it.
@asamiller So I had to cd into the project directory and then run react-native upgrade. That did update certain files, but it did not fix the issue for me.
same here. +1
+1
Anybody figured out a solution for this with android?
ok it seams to be enough to run separatly
[your app]/node_modules/react-native/packager/packager.sh
+1
@shahzeb1 your workaround worked for me as well. thanks
related https://github.com/facebook/react-native/issues/3948
Deleting that build step works and all, but I'm pretty sure that step is required to get the new assets system working when you bundle for running on device... At least, that's what I'm experiencing...no images appear when bundled.
That's what I thought too. Images are acting all kinds of weird after deleting this step.
+1