0
votes

Trying to get code running from my groups repo.... everyone elses seems to install and run fine, but my setup is having issues. Not sure if this is a dependency issue or not.

Tried removing node / npm / nvm and reinstalling everything including code from repo. Still having issues...

React : 0.14.8 react-native-cli: 0.2.0 react-native: 0.24.0

also react-native-cli was installed globally with npm install -g react-native-cli

command after install : react-native run-ios

getting

/node_modules/react-native/Libraries/react-native/react-native.js:121

...require('React'),

^^^

SyntaxError: Unexpected token ...

at exports.runInThisContext (vm.js:53:16)

at Module._compile (module.js:414:25)

at Module._extensions..js (module.js:442:10)

at Object.require.extensions.(anonymous function) as .js

at Module.load (module.js:356:32)

at Function.Module._load (module.js:311:12)

at Module.require (module.js:366:17)

at require (module.js:385:17)

at node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:409:22

at Array.map (native)

1
Do you get the same error when you run npm start in the same directory? - BradByte
@BradBumbalough , yes same error when running npm start - ndyr
Ok, my guess is node issue. What does node -v tell you? I recently had an issue when I upgraded and had to reinstall node because of a similar error. - BradByte
@BradBumbalough v4.2.1 ... I tried removing node ( I believe I got it all too ) and did a reinstall of everything the other day. - ndyr
Did you delete your node_modules and attempt a fresh npm install? I would check what version of babel-core gets installed. I'm assuming you're using npm > 3.0? - BradByte

1 Answers

1
votes

In npm@3 subDependencies are installed at the same level of your project dependencies (./node_modules). My guess is the project is missing some dependencies to run the packager. If you haven't already done so, updgrade to npm@3 ($ npm install -g npm), delete your node_modules folder, then try again.

$ rm -rf node_modules && npm install