title: Metro has encountered an error: While trying to resolve module `@apollo/client`
body: <p>I am trying to install GraphQL into my React Native app and in doing so, I was given this error message.</p>
  <p>I have confirmed that the file actually exists and have quit everything and restarted my server and nothing is working. Any advice is appreciated. Thanks!</p>
  <p>Metro has encountered an error: While trying to resolve module <code>@apollo/client</code> from file <code>/Users/johnhenryluke/Desktop/sparta-app2/App.js</code>, the package <code>/Users/johnhenryluke/Desktop/sparta-app2/node_modules/@apollo/client/package.json</code> was successfully found. However, this package itself specifies a <code>main</code> module field that could not be resolved (<code>/Users/johnhenryluke/Desktop/sparta-app2/node_modules/@apollo/client/main.cjs</code>. Indeed, none of these files exist:</p>
  <ul>
  <li>/Users/johnhenryluke/Desktop/sparta-app2/node_modules/@apollo/client/main.cjs(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)</li>
  <li>/Users/johnhenryluke/Desktop/sparta-app2/node_modules/@apollo/client/main.cjs/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json): /Users/johnhenryluke/Desktop/sparta-app2/node_modules/metro/src/node-haste/DependencyGraph.js (436:17)</li>
  </ul>
  <p>434 |
  435 |         if (error instanceof InvalidPackageError) {</p>
  <blockquote>
  <p>436 |           throw new PackageResolutionError({
  |                 ^
  437 |             packageError: error,
  438 |             originModulePath: from,
  439 |             targetModuleName: to</p>
  </blockquote>
  <p>ABI44_0_0RCTFatal
  __37-[ABI44_0_0RCTCxxBridge handleError:]_block_invoke
  _dispatch_call_block_and_release
  _dispatch_client_callout
  _dispatch_main_queue_callback_4CF
  <strong>CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE</strong>
  __CFRunLoopRun
  CFRunLoopRunSpecific
  GSEventRunModal
  -[UIApplication _run]
  UIApplicationMain
  main
  start_sim
  0x0
  0x0</p>