Posts

Showing posts with the label react-native-cli

Syntax error while initialising react-native app using the CLI

I am getting the following syntax error when I initialise an app using react-native init MyApp SyntaxError: /Users/MyAccount/RNProjects/app/node_modules/react-native/packager/react-packager/src/node-haste/index.js: You can only use Class Properties when the 'classProperties' plugin is enabled. (389:2) 387 | } 388 | > 389 | static Cache; | ^ 390 | static Module; 391 | static Polyfill; 392 | static getAssetDataFromName; at Parser.pp$5.raise (/Users/MyAccount/RNProjects/app/node_modules/babylon/lib/index.js:4380:13) I have no idea why this is happening all of a sudden. It was working all fine before. I guess I deleted some config files by mistake while tinkering. Update They have updated the package so remove your node modules and reinstall them. rm -rf node_modules and npm install More info I was installing the AwesomeProject from getting started. $ rm -rf AwesomeProject/ $ react-native init AwesomeProject And it wo...

React Native - Can not create new project via react-native-cli when react-native version is > 0.55

I am trying to create new project via react native project via react-native-cli react-native init ProjectName and get the following error error Found incompatible module info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this Error: Command failed: yarn add react-native --exact Project can be created with the same command when react native version is less then or equal to 0.54 react-native init ProjectName --version react-native@0.54 The following links also did not helped me. https://github.com/facebook/react-native/issues/14861 https://github.com/yarnpkg/yarn/issues/3227 I came across similar issue. Following are the steps I took to solve it. Noticed the yarn error occurs due to incompatible node module version. It required node version >= 8.0. For this, I changed the node version using nvm: nvm use 8.0.0 Note: Check first if you have a installed node version >= 8.0 using nvm list . If yes, just use the above ...

React Native Configuration Return Error 500, Followed React Native Docs

I have followed all instruction as in docs, but couldn't start my first react native app.Node -v v8.11.4, npm 4.6.1, react-native-cli 2.0.1 See Error Image Here