React-native syntax error unexpected token import when trying to init a new app - react-native

since the update of React-native , when i try to create a new project with the react-native-cli or try to do a command to run a project that i upgrade i get this error. See on the image, it is an error that says import type CommandT from './commands': and i get an error unexpected token import,i want to know if there is a way to change that? even when i try the app with the old version of React-native , it doesn't load the app in the metro bundle

Me too got the same issue after updating react native to 0.56.00. I used the command
react-native init --version="0.55.0"
to create a project. Try this.

Related

React-Navigation and installation error and first-usage

I am new to react-native or you can say new to React and I am working on react-native navigation I have installed all the required libraries as instructed in https://reactnavigation.org/docs/getting-started but when I am running my code it is giving an error as '#react-navigation/native could not be found within the project or in this directories.' What should I do is there any way to get started with my code? Help me
If you have installed your app following the react native cli guide you might want to try running
gradle clean
in your android folder und then try to run your app in the emulator again.
On my first steps with react native I stumpled upon the same issue. :-)

Invariant violation: Native module cannot be null. (App running problem) 2020

I bought a complete app but when I install it in my own environment then it gets back this error.
Try upgrading from expo sdk 37 to expo sdk 38 by running expo upgrade
Looks like there is an open issue on Github. Try this: Invariant Violation: Native module cannot be null
(I already solved this problem to move my file into a new project). But now I'm fetching a new error. I already replace all ListView component with FlatList, and also I have no Icon or Spinner that's I import from react-native or native-base. But it's getting back this error.

'Expo not defined' in React Native

I am working on an App in RN and when trying to run either an Android Emulator or Webpack the error 'Expo not defined' pops up. I have had my instructor look over the code and he hasn't quite figured it out either. The first time I was able to get it working by restarting my computer as well as re-installing node-modules. Any advice? Here is a screenshot.Expo not defined
it looks like you have some code in MainComponent.js that calls Expo.Constants.statusBarHeight - you should remove that
Are you importing Expo in top of file?
import Expo from 'expo';
Can you install expo again?
npm install expo
if u r compiling the code on web then ofc it will show error on expo being undefined but check that app on mobile running expo app it will run there without any error .
Hope it solved your problem

Unexpected Identifier. react-native run-android

I am following this guide to create the project with native code (https://facebook.github.io/react-native/docs/getting-started.html). But I am getting this error after the run command:
This error is a new bug in react-native 0.56 that affects Windows users. To solve it you can create a project with another react-native version:
react-native init --version="0.55.4" MyNewApp
You can see more infos in this GitHub issue.

Twilio import error: Module cannot be null

I've done npm install --save react-native-twilio and react-native-link in my EXPO react-native project. the code compiles without error. But when I add this line of code:
const Twilio = require('react-native-twilio');
in my file, it reports an error says Module can not be null.
I think it is because I didnt link my twilio library to the project right, but I dont know how to fix it, can someone give me some help?
It looks like react-native-twilio has native dependencies and with EXPO, its not possible to include custom native modules. The only way is for you to eject your app to create native builds.
[Official docs for ejecting] (https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#ejecting-from-create-react-native-app)