question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve Module 'React' after upgrading to 0.61.4

See original GitHub issue

I am getting this issue after upgrading to 0.61.4 in ios 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

I tried npm start – – reset-cache, clearing derived data. clean project etc. tried replacing var ReactNative = Object.assign(Object.create(require('React')), { with var ReactNative = Object.assign(Object.create(require('react')), { in /ios/Pods/React/Libraries/react-native/react-native.js

But the issue exists in the file react-native.js

image

React Native version: System: OS: macOS Mojave 10.14.4 CPU: (4) x64 Intel® Core™ i5-5257U CPU @ 2.70GHz Memory: 172.62 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.0 - /usr/local/bin/node Yarn: 1.19.1 - /usr/local/bin/yarn npm: 6.11.3 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 IDEs: Xcode: 11.2/11B52 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: ^0.61.4 => 0.61.4 npmGlobalPackages: react-native-cli: 2.0.1

Steps To Reproduce

  1. Run project from Xcode
  2. The app starts with this red screen with error

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
VictorAtPLcommented, Apr 15, 2020

@krishnadas89 I’ve got the same error.

Steps I’ve done:

  1. rm -rf ios/Pods
  2. rm -rf node_modules
  3. Changed pod 'React', :path => '../node_modules/react-native' to pod 'React', :path => '../node_modules/react-native/' in Podfile.
  4. npm cache clean --force
  5. npm install
  6. npm install redux
  7. cd ios && pod install
  8. Bulit project in Xcode
  9. Run app in Xcode

And it worked. 👍

5reactions
thymikeecommented, Nov 15, 2019

Oh, I see it now. Metro tries to resolve ios/Pods/React/Libraries/react-native/react-native.js but there shouldn’t be React pod in your pods, it should be taken from node_modules.

Remove ios/Pods and run pod install again. Also make sure your Podfile is valid and looks like this one: https://github.com/facebook/react-native/blob/0.61-stable/template/ios/Podfile

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Unable to resolve module `react` from `index.js`
I installed react again once more.Using 'npm i react' and error is solved.
Read more >
unable to resolve "@react-navigation/native" from "app.js"
This error occurs because you haven't installed react-navigation. Run: npm install react-navigation npm start ...
Read more >
Upgrading to new versions - React Native
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's...
Read more >
Cannot find module 'react/jsx-runtime' or its corresponding ...
To solve the error "Cannot find module 'react/jsx-runtime' or its corresponding type declarations", make sure to install the typings for react running the ......
Read more >
Beginner help - can't seem to fix my dependencies : r/reactnative
ERESOLVE unable to resolve dependency tree ... Could not resolve dependency: ... npm ERR! react-native@"0.61.4" from the root project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found