React-Native: React could not be found within project or in these directories

none of these files exist react-native
react-native-screens could not be found within the project or in these directories
make sure react-native'' module is installed in your project dependencies
react-native-elements could not be found within the project
react-navigation could not be found within the project
install react-native
unable to resolve module 'react'
node_modules@react-native-community/cli-platform-androidnative_modules gradle as it does not exist

We have upgraded our react native project to the latest react native version (v0.61.2) with react (16.9.0) and it works perfectly fine on android. When we try to run it on ios thought, we get the message:

warning: the transform cache was reset. Loading dependency graph, done. error: bundling failed: Error: Unable to resolve module `React` from `ios/Pods/React/Libraries/react-native/react-native.js`: React could not be found within the project or in these directories:   node_modules

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*

We have followed the upgrade guide, updated all dependencies to their latest version and updated the pods. I actually don't know where or how to start debugging this, since this seems to be coming from the Pods folder.

This is the content of our Pods folder:

ls ios/Pods/
Adjust              GoogleDataTransport
Crashlytics         GoogleDataTransportCCTSupport
DoubleConversion        GoogleUtilities
Fabric              Headers
Firebase            Local Podspecs
FirebaseABTesting       Manifest.lock
FirebaseAnalytics       Pods.xcodeproj
FirebaseAnalyticsInterop    Protobuf
FirebaseCore            Pushwoosh
FirebaseCoreDiagnostics     PushwooshInboxUI
FirebaseCoreDiagnosticsInterop  React
FirebaseDynamicLinks        Target Support Files
FirebaseInstanceID      boost-for-react-native
FirebaseRemoteConfig        glog
Folly               nanopb
GoogleAppMeasurement

and in our node_modules folder, we have (with a lot more other packages):

...
react
depd                        react-deep-force-update
des.js                      react-devtools-core
destroy                     react-is
detect-libc                 react-lifecycles-compat
detect-newline              react-native
...

I have, of course, tried all the steps, like clearing caches, reset-cache, clearing DerivedData, Clean and build, ... I don't know where to start looking.

I fixed it by replacing

import Foobar from "screens/foobar";

with

import Foobar from "./screens/foobar";

note the beginning ./ in the path

facebook/react-native, module React from ios/Pods/React/Libraries/react-native/react-native.js: React could not be found within the project or in these directories:  bundling failed: Error: Unable to resolve module react-navigation-stack from App.js: react-navigation-stack could not be found within the project. i tried removing the node modules and reinstalling them, clearing the cache, trying the same in a new fresh project but no result. Package.json file

I was facing the same error when upgrading from v0.60.3 to v0.61.4.

I needed to change

import React, { Component } from 'React';

to

import React, { Component } from 'react';

Notice the lowercase 'r'.

facebook / react-native, The module ./index could not be found from \node_modules\react-native\scripts/​. Screen Shot 2019-03-14 at 15 47 39. *I am inside the right folder btw I already had a metro.config.js file in the project root directory. I am using react v16​.8.5  Teams. Q&A for Work. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

I don't know if you tried to update your pods or not but you could try to do following inside your ios/ folder:

pod repo update && pod install

It might help.

bundling failed: Error: Unable to resolve module ` react-native , js`: react-native-screens could not be found within the project. Your Environment. software, version. react-navigation, 3.11.1. react-native, 0.61. we're not trying to make your life difficult. react native doesn't include many features and it's necessary to use third party native modules to achieve the behavior we want. the setup is the way it is because it's not possible to make it easier.

last week, I also met the problem, it caused by the react path had changed.

open your ios folder Podfile, edit the react path. it had moved into react-native

 pod 'React', :path => '../node_modules/react-native/'
 pod 'React-Core', :path => '../node_modules/react-native/'

then cd ios folder and run pod install in the terminal

expect above, if you had met other upgrade problems, you can go to this site compare the related files

0.62.1. error: Error: Unable to resolve module `react-native/Libraries , js`: react-native/Libraries/vendor/core/isEmpty could not be found within the project. #28546. Closed. studass opened this issue on Apr 6 · 9  I had the same problem and tried everything that was suggested. I finally got it to work by running the second command in this step: Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.

Try to delete both Pod folder and Podfile.lock, under ios directory. Then run pod install again.

That worked for me.

Unable to resolve module 'react-native-safe-area-context' · Issue , js : @react-native-community/masked-view could not be found within the project." Any ideas? info iOS module "react-native-gesture-handler" is not installed Create a file named react-native.config.js in the root directory of your project. Means in this case it will be under folder AwesomeProject, and this file will be adjacent to other files such as - package.json etc Add below code to the react-native.config.js file

react-native, Unable to resolve module React from ios/Pods/React/Libraries/react-native/​react-native.js : React could not be found within the project or in these directories:​  Some of the errors you may encounter could be misleading or very hard to find. Recently, the React Native team asked developers to help them determine which of these annoying errors lead to the most frustration. While they did address some of the worst errors, there is still a handful remaining that could go under the radar.

Troubleshoot the most common React Native build errors , Tips and tricks for troubleshooting the most common causes of React Native mobile A frequently seen issue is a package.json that specifies non-explicit versions of from <path>: Module does not exist in the module map or in these directories: /react-native-fbsdk/blob/master/ios/RCTFBSDK.xcodeproj/project.​pbxproj. This project aims to expose native navigation container components to React Native. It is not designed to be used as a standalone library but rather as a dependency of a full-featured navigation library. How can I take advantage of that?

[React Native][react-navigation]bundling failed: Error: Unable to , js`: react-native-screens could not be found within the project. Answers : well i have solved this by reinstalling / updating these packages. npm  $ react-native-cli: 2.0.1 $ react-native: n/a - not inside a React Native project directory. So we can proceed to create our project. Creating a project from Scratch. Choose a directory of your choice to create our base project using the following command: $ react-native init ReactNativeCklExample

Comments
  • Having exactly the same here.
  • Thanks, worked for me. Changed Cap R to small r in destination js file
  • I have changed as per above but it shows error as Fetching podspec for BVLinearGradient from ../node_modules/react-native/react-native-linear-gradient [!] No podspec found for BVLinearGradient in ../node_modules/react-native/react-native-linear-gradient
  • @sejn, it is the same, react-native-linear-gradient don not exist in Podfile. according to the API(npmjs.com/package/react-native-linear-gradient); add this pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
  • [!] Unable to find a specification for React-Core depended upon by rn-fetch-blob [!] Automatically assigning platform ios with version 8.0 on target App because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
  • @sejn modify rn-fetch-blob.podspec: s.dependency 'React-Core' .you can also run this grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g' in termail
  • Shall I need to change in podfile as s.dependency 'React-Core'