8

In my app.json folder, I have everything bundled nicely, but I have one undefined package at the bottom of the install list:

"undefined": "react-navigation/bottom-tabs"

I tried running an "npm install react-navigation/bottom-tabs" but it threw this error:

warn Package undefined has been ignored because it contains invalid configuration. Reason: Cannot find module 'undefined/package.json'

Has anyone encountered an issue like this before? I am running React-Native Version 5 on top of Expo.

EDIT: It turns out that it was supposed to be @react-navigation/bottom-tabs, so I installed that and made an adjustment; but now I am still stuck with the original undefined package in my app.json folder, and cannot get rid of it.

MK_Pierce
  • 916
  • 2
  • 10
  • 26

2 Answers2

6

So, I forgot this post existed and I actually figured this out months ago. When you're dealing with:

A bad bundle,

the wrong version,

or there's just something wrong with your 'package.json' file, (the file that contains the list of your packages)

These steps should fix it:

  1. Perform "npm uninstall 'package-name' " or "yarn remove 'package-name'"

Note: You do this instead of 'expo-uninstall' because 'expo-uninstall' does not exist. We use 'expo-install' instead of 'npm' or 'yarn' install to make sure you download the proper npm or yarn version associated with your version of expo.

  1. Open the package.json file and see if the bad package you uninstalled is still present.

  2. If the bad package is still there, select and delete it from the file, then save.

  3. Run an "expo" "npm" or "yarn" install on the correct package name

This should fix it. This is best fixed when step 4 is executed with an 'expo install' as you likely have an incompatible version of the package, so this will prevent that from happening again.

In my case, I couldn't figure out why my terminal was telling me a specific package didn't exist, so I did a "sud" command to force download the package. This package didn't exist, because I had actually spelled it wrong.

MK_Pierce
  • 916
  • 2
  • 10
  • 26
0

try deleting your node modules and install them again and make sure your metro is closed clear cache and you are good to go by the way it worked for me

npm install or yarn add

npm start --reset-cache
faraz naeem
  • 91
  • 1
  • 5