Error: Requiring module "node_modules\expo-media-library\build\MediaLibrary.js", - react-native

I made a react native project using react-native init newProject .I wanted to use expo modules in the project in this module so I ran npx install-expo-modules to use expo modules after using this command I installed expo module expo-media-library and when I import this
Error: Requiring module "node_modules\expo-media-library\build\MediaLibrary.js", which threw an exception:
TypeError: undefined is not an object (evaluating '_ExponentMediaLibrary.default.MediaType')

go with npm install expo-media-library or yarn add expo-media-library

try expo upgrade then expo doctor. mine also stucked there for a while. it even causes AppRegistry error that said main is not registered. should've tried with older versions

Related

expo cli warning: 'unrecognised event type: transformer_load_started

I'm getting a weird warning when I start newly created expo projects using expo init and expo start. The project loads and I am able to work, but I get this warning:
Unrecognized event: {"type":"transformer_load_started"}
Unrecognized event: {"type":"transformer_load_done"}
I have no idea what this means or what caused this. When I load up older projects using expo start, I do not get this error.
Any ideas on how to fix this? Thanks.
I have the same issue with just a simple project.
With some experimentation, I found that it caused by my Expo version which is "expo": "^45.0.0" in packages.json
Initializing your new projects with Expo SDK 44 by using this command should fix the issue:
expo init --template blank#44.0
Maybe it will be fixed in a Expo SDK 45 update.
EDIT:
I updated expo-cli to the last version (5.4.12) with npm install -g expo-cli and it fixed the issue with Expo 45.

Trying to import realm, but getting error: Missing Realm constructor. Did you run "pod install"? (I'm using windows)

I'm making a mobile application with react native.
I want to use Realm (mongodb).
So after running:
npm install realm
realm was correctly added in the "node_modules" and I tried to import realm with:
import Realm from "realm";
If I do npm start and test the app, I get to following error message:
Error: Missing Realm constructor. Did you run "pod install"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting
I'm using windows and testing the app on an android device. Earlier questions about this matter on the internet suggested it is in my situation not needed to do "pod install".
I also tried to autolink realm, with:
react-native link realm
But then I get the warning:
warn Calling react-native link [packageName] is deprecated in favor of
autolinking. It will be removed in the next major release. Autolinking
documentation:
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
(node:26016) Warning: Accessing non-existent property 'padLevels' of
module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created)
Does that mean that the autolinking is not successful, because autolinking will be removed in the next release?
Does any of you have suggestions on how I can successfully import Realm in my react native project?
Here are some of the dependency versions:
"expo": "^44.0.0",
"realm": "^10.14.0"
"react-native": "0.64.3",
Add this package:
npm install realm#hermes
Works for me.
run this command:
expo run:android
you must build your project first
and remember realm is working only on production environment
As the error message suggests, you need to install the pod files for realm to work with iOS. Those are the steps:
In your project folder run npm install realm. It adds the npm package to your react native project
In your iOS folder (cd ios) run pod install. It gets all iOS realm libraries and compiles the iOS-part of your npm package and creates the .xcworkspace.
Add the import to your component: import Realm from "realm";
Switch back to your project folder and run your project: react-native run-ios
Hope that solves your problem!

How to fix "unable to resolve module expo module does not exist in the haste module map"

Im developing a react-native application, i created my project with
react-native init MyApp
i imported LinearGradient
import { LinearGradient } from 'expo'
i got this error:
unable to resolve from "/Project/Nav/App.js".
Module expo module does not exist in the haste module map
i tried to delete the node_modules folder and install all the package again but the error persist, i also clean the ios build folder but the same error showed up again
You're not using expo when you create a project with
`react-native init MyApp`
The expo cli command is
`expo init MyApp`
make sure you've installed expo globally
npm install -g expo-cli

React Native 'expo-asset requires expo-file-system package to be installed and linked' ERROR

I run my react native on android simulator and I got this error:
expo-asset requires expo-file-system package to be installed and linked
On iPhone its works fine and there is not error.
Thanks
According to this post
https://github.com/expo/expo/issues/3027
you should run the following command:
npm install react-native#0.55.2

react-native reazy unable to resolve module

I am trying to test out the reazy react-native framework, I can't get the sample app up and running.
when I run the react-native run-ios command i am getting the following error:
unable to resolve module react/lib/reactComponentwithPureRenderMixing
node_modules/react-native-router-flux/node_modules/react-addons-pure-render-mixin/index.js
Module does not exist in the module map
I have removed my modules and reinstalled them. the module folder is there for react-native-router-flux
nothing in the JS console
any help is appreciated
Please install router flux using below and refresh
npm install --save react-native-router-flux
Hope! this helps.
Run the following command and it will be solved-
yarn add react-addons-pure-render-mixin
this is manual step to add this module.