'error 'undefined is not an object' using @react-navigation/drawer (checked docs and issues)

I'm not sure what the issue is, but I've looked at the docs and it's done correctly, and I've even looked at issues on Github and SO and nobody seems to be having the exact same issue. Here is what I'm using:

React Native .66.1 React Navigation Native 6.0.6 React Navigation Stack 6.2.5 React Navigation Drawer 6.1.8 React Native pager 0.0.3 React Native reanimated 2.2.4 React Native Screens 3.9.0

When I try to use the createDrawerNavigator module from @react-navigation/drawer I get these errors:

undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[10], "@react-navigation/drawer").createDrawerNavigator')

new NativeEventEmitter() requires a non-null argument

Requiring module "node_modules/@react-navigation/drawer/src/index.tsx", which threw an exception: Invariant Violation: 'new NativeEventEmitter()' requires a non-null argument.

I've tried uninstalling/reinstalling and following the docs to a T, deleting node_modules etc., all to no avail. Any insights?

My package.json file (if it helps):

{
  "name": "customApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
  },
  "dependencies": {
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "^6.2.5",
    "react": "17.0.2",
    "react-native": "0.66.1",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-pager": "^0.0.3",
    "react-native-reanimated": "^2.2.4",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.9.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-vector-icons": "^9.0.0",
    "react-native-video": "^5.2.0",
    "view": "^1.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@types/jest": "^26.0.23",
    "@types/react-native": "^0.65.0",
    "@types/react-native-video": "^5.0.10",
    "@types/react-test-renderer": "^17.0.1",
    "babel-jest": "^26.6.3",
    "eslint": "^7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.66.2",
    "react-test-renderer": "17.0.2",
    "typescript": "^3.8.3"
  },
  "resolutions": {
    "@types/react": "^17"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source