1

Hello I am getting an issue when trying to run react-native init.

SyntaxError: Unexpected token ...

/Users/jordan/Projects/React/LiveInstagram/node_modules/metro-bundler/build/lib/TerminalClass.js:141 this._nextStatusStr = util.format(format, ...args);

Does anyone know how I can remedy this issue? Thanks!

7
  • 1
    perhaps it's the rest operator ... that is not understood Commented Jul 6, 2017 at 3:03
  • Well that is what the error looks like, but since it is in the metro-bundler I don't know how to fix that. Commented Jul 6, 2017 at 11:45
  • What's your node version? @j5juice Commented Jul 6, 2017 at 18:00
  • 4.6.0 is my Node version. 5.0.3 is NPM version. 2.0.1 is react-native-cli version. Commented Jul 6, 2017 at 22:10
  • My answer to this question was deleted by reviewer, but this is possible duplicate question, answered the same issue here: stackoverflow.com/a/45267703/1292050 Commented Jul 24, 2017 at 15:44

5 Answers 5

2

There are compatibility issues in the updated react-native cli. Using the downgraded version solves this problem. $ react-native init [project name] --version 0.38.0

https://github.com/facebook/react-native/issues/11384

Sign up to request clarification or add additional context in comments.

Comments

2

Currently it works for me with node v8. My solution:

sudo npm install -g npm
sudo npm cache clean -f
sudo npm install -g n
sudo n stable

1 Comment

this worked for me as it updates node.js to its most stable version.
0

So I completely uninstalled Node then reinstalled it and react-native-cli and it worked correctly.

Comments

0

I had the same problem with nodejs v4, solve this by updating nodejs and npm. sudo purge nodejs npm curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs

Comments

0

I had an older node version. so upgraded to 18.17.1 and worked for react native 0.72.5

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.