React Native TransformError - react-native

I just created a react native app and did an npm install after that. I tried running the app after npm install, and this showed in my emulator. How do i fix this guys?

I had the same problem with "babel-preset-react-native", I removed version 3.0.0 and installed it to 2.1.0.
Remove folder babel-preset-react-native inside node_modules
Change the version of babel-preset-react-native in package.json to 2.1.0
Run npm install

Related

problem with expo react native navigation

i am using react-native with expo to run my app on my android devices when i load my app on my terminal i have this error
Some dependencies are incompatible with the installed expo package version:
#react-native-community/masked-view - expected version: 0.1.10 - actual version installed: 0.1.11
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
Missing package "metro-config" in the project at: C:\Users\kabore\Desktop\react_native\app1
This usually means react-native is not installed. Please verify that dependencies in package.json include "react-native" and run yarn or npm install.
Error: Missing package "metro-config" in the project at: C:\Users\kabore\Desktop\react_nativ
simply remove the node_modules folder and run yarn install or npm install in the command line to install dependencies again .it seems like some of your dependencies are not installed correctly

Cannot Downgrade React-Native version from 0.62 to 0.61.4

Expo 37 mentions it will work with react-native 0.61.4. When I check my react-native version, it states:
$ npm view react-native version
0.62.2
I have tried: 1-) Running npm remove react-native, then clearing package-lock.json, then setting react-native version 0.61.4 in package.json, and running npm install again. Tried only npm install react-native#0.61.4 as well.
When I run the verification the result is the same:
$ npm view react-native version
0.62.2
How can I properly downgrade to react-native 0.61.4?
npm view react-native version shows the version of current stable version is available.
to check local version, just run:
npm outdated, this will show your local outdated version or using list npm list --depth=0 in root directory

Cannot find module 'expo/bundleNativeModules.json'

I'm using expo to build an app. I'm new to React-Native and expo so if you could help me, I'd be really appreciated.
I get a couple of warnings that says:
Some of your project's dependencies are not compatible with currently installed expo package version
- expo-constants - expected version range: ...
- expo-permissions - expected version range: ...
- react-native-gesture-handler - expected version range: ...
Your project may not work correctly until you install the correct versions of the packages.
I was facing another error:
"TypeError: TypeError: undefined is not an object (evaluating '_styles.default.list')".
So I'm trying to install the latest version.
When I try to install expo install expo-permissions and expo install react-native-gesture-handler, I get errors.
Both errors say
Cannot find module 'expo/bundledNativeModules.json'
Require stack:
- /Users/address/src/react-native-udacicards/noop.js
I tried to remove node_modules and package-lock.json then npm install.
rollback with npm install -g expo-cli#2.4.3
I don't know if this solution will work for all the situations, but this is what fixed the issue it for me:
clean the npm cache using the following command : npm cache clean --force
re-install the dependencies : npm install
expo install
I hope it helps
1.on your package.json change expo version to
"expo": "~43.0.2", (or lower)
and your react-native-gesture-handler to
"react-native-gesture-handler": "~1.10.2",
(for expo 43.0.2)
Then, on your terminal (in your project), run
npm cache clean --force
npm install
expo doctor --fix-dependencies
I also faced this issue but Enableing USB tethering in phone, and clearing all data in expo app resolved this issue.

errors after running expo start

I have installed latest node version and expo-cli but when I run the command expo start, it gives me this error:
Starting project at C:\Users\Ogacho\Desktop\sharelocation
Expo DevTools is running at http://localhost:19002
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older.
Opening DevTools in the browser... (press shift-d to disable)
Error: React Native is not installed. Please run `npm install` in your project directory.
Couldn't start project. Please fix the errors and restart the project.
Set EXPO_DEBUG=true in your env to view the stack trace.
I have tried clearing my npm cache, deleting my node_modules folder and reinstalling...
This fixed it for me:
Run expo update 35.0.0. (Replace version with your desired version. 35.0.0 is the latest as of this post.) This updates expo, by updating app.json & package.json and installing the latest dependencies.
Referenced from:
https://docs.expo.io/versions/latest/workflow/upgrading-expo-sdk-walkthrough/
Also, check that:
your expo app is the latest version through the app/play store.
your expo cli is the latest version npm install -g expo-cli
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older. If your expo-cli version is older than 2.21.2, run npm install -g expo-cli to get the latest version.
Or, you can change sdkVersion and dependencies to an older version to match the expo-cli doc.Run expo --version to get the expo-cli version. For example, if using expo-cli 2.19.5, you should
app.json, change sdkVersion to "32.0.0",
In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"expo": "^32.0.0",
"react": "16.5.0"
}
Delete your project’s node_modules directory and install again
Close your Expo CLI server
Run expo upgrade in your project directory (requires the latest version of expo-cli, you can update with npm i -g expo-cli).
Make sure to check the breaking changes section of this post!
Run expo start -c

react native Cannot find module 'metro/src/reactNative Transformer'

When upgrading to RN 0.59.4 and after a successful build - one can encounter the following error in metro bundler:
react native Cannot find module 'metro/src/reactNative Transformer
I think there's an issue with the version of metro packaged with the latest RN Upgrade.
I just installed locally in dev metro npm install --save-dev metro, which is the version 0.51.1, and that worked for me.
Reference: https://github.com/facebook/metro/issues/293#issuecomment-452779809
Make sure that you at least:
"metro-react-native-babel-preset": "0.53.1"
In dev dependencies in your package.json file
I solved the problem by deleting the node_modules folder and the package-lock.json file and then running again npm install
Since you upgraded ReactNative, you must close terminal where Metro is running and then re-run npx react-native start