Cannot find module 'expo/bundleNativeModules.json' - react-native

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.

Related

Unable to find expo in this project - have you run yarn / npm install yet?

I'm Unable to execute the expo start command.
Error Message:
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> expo start
Starting project at C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project
Unable to find expo in this project - have you run yarn / npm install yet?
├─ action (C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:34:11)
├─ C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:135:22
└─ expo start (C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:350:7)
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> npm install
added 28 packages, removed 46 packages, changed 34 packages, and audited 653 packages in 8s
17 packages are looking for funding
run `npm fund` for details
7 low severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> npm audit
npm audit report
node-fetch <=2.6.0 || 3.0.0-beta.1 - 3.0.0-beta.8
Denial of Service - https://npmjs.com/advisories/1556
No fix available
node_modules/isomorphic-fetch/node_modules/node-fetch
isomorphic-fetch 2.0.0 - 2.2.1
Depends on vulnerable versions of node-fetch
node_modules/isomorphic-fetch
fbjs 0.7.0 - 1.0.0
Depends on vulnerable versions of isomorphic-fetch
node_modules/fbjs
metro 0.22.1 - 0.63.0
Depends on vulnerable versions of fbjs
Depends on vulnerable versions of metro-config
node_modules/metro
#react-native-community/cli *
Depends on vulnerable versions of metro
Depends on vulnerable versions of react-native
node_modules/#react-native-community/cli
react-native <=0.0.0-ffdfbbec0 || 0.22.0-rc - 0.64.0-rc.4
Depends on vulnerable versions of #react-native-community/cli
Depends on vulnerable versions of fbjs
node_modules/react-native
metro-config <=0.63.0
Depends on vulnerable versions of metro
node_modules/metro-config
7 low severity vulnerabilities\
Some issues need review, and may require choosing
a different dependency```
Change expo version from "^1.0.0" to "~41.0.1" (package.json)
npm install
npm start
if anyone is still facing issues, run
yarn add expo
if you don't have yarn installed on your computer then run
npm install -g yarn
and then run the first command.
I also received your message when installing the commands in the "React Navigation" set-up instructions and fixing vulnerabilities. The problem arises when using the command: npm audit fix --force. If you check the warnings after this command, you get
npm WARN audit Updating expo to 1.0.0, which is a SemVer major change.
So, try running: sudo expo update
If that doesn't work, try installing expo again with: npm install --global expo-cli and then update.
I'm also facing this error. So I run the npm command in the terminal.
npm install
You do not need to change the expo version. you just reinstall it.
Update the Expo to the latest version sudo expo update
Then install the updated npm packages npm install
Fix the issues in the packages npm audit fix --force
Run the Application npm start or expo start
Error ? you are trying to launch the expo framework yet it can't be found installed as part of your application modules
solution? simply find the latest version of Expo i.e for my case "expo": "^44.0.0", then go to your package.json file in your root folder, under the "dependencies" property plug-in that Expo version i.e
"dependencies":{
"expo": "^44.0.0",
}
close package.json file, then in your root folder run the command: npm install
after package installation is done run expo start
I simply used the expo update command.
It asked me
You are currently using SDK 1.0.0. Would you like to update to the
latest version, 44.0.0?
and I said yes, y not..
Every Thing was good to go with the npm start command
Cheers..
See the expo version - default "^1.0.0" , change ==> "expo": "~41.0.1"
Change expo to version "~43.0.0" in package.json
run npm audit fix --force in node_modules directory
here are my 2 cents. This worked for me :
Download latest version of nodejs - https://nodejs.org/en/download/
After installing nodejs reboot your computer
install : npm install --global expo-cli
Generate a new project with - npx expo-cli init projectName
cd projectName
npm start
you can run the below to install all dependencies
npm i
or to install exp
npm i -g expo-cli
This problem I faced was because of cloning a new project and trying to run it.
Always install the modules using the below command
I solved this by
npm install or npm i
I had same problem.
I simply used the expo update command.
You are currently using SDK 1.0.0. Would you like to update to the latest version, 44.0.0?
and I said yes.
Every Thing was good to go with the npm start command
thats all
Is possible that you need an update try this command:
sudo expo update
Please try this
npm install --save expo --legacy-peer-deps
no need to edit package.json if expo version is not 1.0.0
You should register first on expo and then login
I had the same issue but after I logged in it was solved.
here is all about : https://docs.expo.dev/get-started/installation/
In my case, I clonned a Github repository and then used create-expo-app inside the repository directory. So, the command created a directory with the name of the app, but I was not in it: I was running the expo run command in the wrong directory.
Double check that the package.json is in the same directory in which you are running yarn or expo run to avoid this simple mistake.
The same error happened to me. But none of the other answers helped me. In my situation, I have node.js v18.12.1 installed. But when I check with nvm ls, the arrow points to "system", and on my system Xubuntu 22.04, the nodejs version installed is v12.22.9. So I needed to do nvm use 18, then
yarn add expo
expo start
Problem solved!
for window users
just type expo update into your terminal,

RN Expo issue - Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app

I am using react native and Expo. I am unable to build new app because after I use expo init appName it shows the following error.
Heres the full message:
📦 Using npm to install packages. You can pass --yarn to use Yarn instead.
√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
I tried multiple times to create a blank project, also tried npm install to install failed/not downloaded libraries and continue after failure but it showed another error:
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
also tried npm cache verify that showed cache is ok Content verified: 3562 (252580364 bytes).
So, How can I solve this issue?
Problems related to npm installation are very common If you do any mistake in early installation, but is avoided. Learn more about npm tree.
Steps worked for me are :
npm cache clean --force
npm cache verify
npm -g uninstall expo-cli --save
npm install expo-cli --global
expo init app-name
cd app-name
npm start
Always run as administrator if working on Windows and in root directory.
The solutions above didn't work for me but if you use 'npm install' in the directory of the app you get a clue that you shuold try 'npm install --force'
err message
You should have all these files folders and files at the start of the project otherwise not all the dependencies have been installed which is why we were getting the problem.folder structure
After you have added --force to npm install you have all the dependencies installed. Now you can run the app with npm start.
Unfortunately, all the solutions described above didn't work on my machine...
Here is my latest solution for this problem...
This worked 100% on my machine...
Use npm i -g expo-cli
This will automatically add the required packages and also remove the unnecessary ones.
Yes, surely, you don't need to uninstall and re-install it again.
Just follow my steps.
And, you can create your expo project using expo init.
I hope my solution will help you out from this annoying problem....
I just did npm install and it worked for me, but I had do that every time I create a new expo project.
I also encountered this problem, and finally found that it was the problem of react native cli,I installed the latest version of react native cli,Expo is back to normal
This Error is regarding to the git account. expos need a git account to setup react native project
If you are using windows you need to install git in your local PC
after that open your Terminal and type this command
git config --global user.name "your_username"
git config --global user.email "your_email_address#example.com"
after that clone any github project to your local computer. it will ask to login to Github
after all these steps try expo init <projectname>
The simple way to settle that error is by using "expo-cli init app-name" instead of "expo init app-name".
I tried and worked perfectly for me. Hope it will help you guys.
i have faced a similar problem and running yarn set version 1.22.1 fix it
Run the Command Prompt as an administrator. And run the following command:
npx create-expo-app AwesomeProject

React Native Accessing view manager configs directly off UIManager via UIManager['AIRMap'] is no longer supported

I'm getting the following warning "Accessing view manager configs directly off UIManager via UIManager['AIRMap'] is no longer supported. Use UIManager.getViewManagerConfig('AIRMap') instead". Its been showing since I have installed the react-native-maps package. Should I ignore it or its there a solution for it?
Thanks in advance
This is fixed by downgrading "react-native-gesture-handler" to 1.3.0. You also need to clear the cache or you'll continue to see the warning.
Modify your package.json:
"react-native-gesture-handler": "~1.3.0"
Reinstall dependencies:
npm install or yarn install
Restart expo with a clear cache:
expo r -c
To hide the warning, downgrade react-native-gesture-handler to ‘1.3.0’.
yarn add react-native-gesture-handler#1.3.0
This appears to be a known issue with react-native 0.58 https://github.com/react-native-community/react-native-maps/issues/2620
This is for those who want a quick fix, here are some commands that you can run to fix it. Remember this solution is for expo users.
// make sure you have the latest expo-cli (if you have >=3.1.0, you can skip this)
$ npm install -g expo#latest
// remove your node_modules and package-lock.json (just to be sure)
$ rm -rf node_modules package-lock.json
// check if you have `react-native-gesture-handler` listed already (if so **remove it**)
$ cat package.json | grep react-native-gesture-handler
// use expo to install the appropriate version
$ expo install react-native-gesture-handler
// start expo with a clean cache
$ expo start --clear
you need just downgrade react-native-gesture-handler to 1.3.0.
also You can do these steps:
directly change version in your package.json to ~1.3.0
run npm i or remove it and install through expo
sometimes it needs to clear cache of expo > expo r -c
If you are using expo, you can now use the command
expo install react-native-gesture-handler
This will make sure nothing breaks by installing react-native-gesture-handler in version 1.3.0 instead of 1.5.x.
There is a pretty recent issue on Github discussing this.

Running into 'Cannot read property 'ReactCurrentOwner' of undefined' after installing packages

I run into the following error in ReactNative on app launch:
Cannot read property 'ReactCurrentOwner' of undefined
This usually happens after installing a new package or switching branches on my project with different sets of packages installed.
I'm can resolve it by running react-native-git-upgrade but this does not seem like a real solution.
Any ideas what can cause this error and how to avoid it?
was having the same issue and as you say, it's a version compatibility problem in react and react-native. Would also affect expo if you're using that.
React + React-native have to use specific versions that work with each other.
The react-community org on Github provides a table that helped me install the correct versions. Here are a few examples from that document:
react-native#0.41.x and 0.42.x need react#15.4.x
react-native#0.43.x and 0.44.x need react#16.0.0-alpha.6
react-native higher than 0.44 to 0.48 need react#16.0.0-alpha.12
Note that I did npm install --save react#<correct version>
Then rm -rf node_modules && npm install
And lastly: npm start --reset-cache
My app runs again!
It happens when your React-dom version is ahead of your React version and they are incompatible. Like the following will give this error as React-dom 16 is not compatible with React 15.
"react": "^15.6.2",
"react-dom": "^16.4.1",
Upgrade react or downgrade react-dom, basically use a compatible version of the both and that should fix the issue.

react-native 0.1.5 TransformError: /path_to_app/index.ios.js Unknown plugin "node-env-inline"

I've just updated both watchman, homebrew and react-native-cli
The result is that all my new as well as old react-native applicationsare giving the same error.
It is a TransformError in index.ios.js
this is what i got in the simulator
I looked into this question:
[TransformError when running React Native Getting Started project (iOS)]
(TransformError when running React Native Getting Started project (iOS))
But, the answer did not worked for me.
i did :
rm -rf node_modules
npm cache clean
npm i
npm start
and it did not work.
Does any one know what is happening?
I ran into this issue as well. It appears to be a missing babel plugin. Run npm install babel-plugin-node-env-inline to fix. I also had to install babel-plugin-dunderscore-dev-inline.