Closed
Description
(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
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
topicus commentedon Nov 6, 2015
Same issue here.
adamtwiss commentedon Nov 6, 2015
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:
MicheleBertoli commentedon Nov 6, 2015
+1
ffugly commentedon Nov 6, 2015
+1
shahzeb1 commentedon Nov 6, 2015
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.
bradbyte commentedon Nov 6, 2015
Thanks @shahzeb1, that solved my problem.
TalkingQuickly commentedon Nov 6, 2015
+1
l-lawliett commentedon Nov 6, 2015
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
asamiller commentedon Nov 6, 2015
Runningreact-native upgrade
fixed this for me.Update: Sorry, turns out this didn't fix it.
shahzeb1 commentedon Nov 6, 2015
@asamiller So I had to
cd
into the project directory and then runreact-native upgrade
. That did update certain files, but it did not fix the issue for me.nvcken commentedon Nov 7, 2015
same here.
+1
m20io commentedon Nov 7, 2015
+1
m20io commentedon Nov 7, 2015
Anybody figured out a solution for this with android?
m20io commentedon Nov 7, 2015
ok it seams to be enough to run separatly
[your app]/node_modules/react-native/packager/packager.sh
sarahsalder commentedon Nov 7, 2015
+1
35 remaining items
adokania commentedon Mar 3, 2016
What worked for me is running 'npm start' from react-native root..
hchoriq commentedon Mar 3, 2016
nvm alias default v5.6.0 did it for me. It was referencing an older node version by default.
jsierles commentedon Mar 20, 2016
@facebook-github-bot answered
facebook-github-bot commentedon Mar 20, 2016
Closing this issue as @jsierles says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.
SudoPlz commentedon Mar 21, 2016
For people that still struggle with this, THIS so answer immediately solved my problem with 1 click.
Muneefm commentedon May 3, 2016
Hi.
i had this issue couple days ago. and i was stuck with this. i tried everything i saw in here and stackoverflow. and at last i sorted out the issue.
my issue was i had already installed the node.js for some other reason.. and when i started with react native i reinstalled the node through nvm. but it seams like react was using the node that i have already installed. i guess that was old version. anyway so i just removed every node modules. and reinstalled everything. this answer helped me for that. http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x
SudoPlz commentedon Jun 3, 2016
SOLVED: For people looking for an answer to this in the future just add the line this SO post says. http://stackoverflow.com/questions/37230040/why-does-mainjs-bundle-not-build-with-reactnative-0-25-1/37614200#37614200