The problem
Open react native issue here
I have researched this error extensively (~ 2days dev time) but somehow still no resolution - I have run previous React Native setups fine and thought this might resolve as a final step (see the end of issue).
In short, when I run react-native run-ios
from example "AwesomeProject" directory I get the below error in the React Packager launchPackager.command window.
~/AwesomeProject2/node_modules/react-native/packager ~ /Users/alexanderhandy/AwesomeProject2/node_modules/react-native/local-cli/cli.js:74
const setupEnvScript = /^win/.test(process.platform)
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
My setup
Steps
git fetch; git reset --hard origin/master
. ~/.nvm/nvm.sh
in terminal to get nvm working, when I don't v5.7.0 becomes v0.12.4. I have double-checked node is v5.7.0 when error runsreact-native init AwesomeProject
which completed but hanged for like 10 minsreact-native run-ios
and got error and tried to add source ~/.bash_profile
to node_modules/react-native/packager/react-native-xcode.sh
as suggested here
I had the same problem when creating my project from react-native init
command. What I did to get a successful build was do npm install babel
and then finally do react-native run-ios
. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With