We use GitHub Issues for bugs.
I recently created a new project using react-native init MyProject. The app ran fine initially.
However now, when I run react-native run-ios or try to use xcode to run the app. I get the following error screen.

I have followed the suggested instructions and have ran the following
rm -rf node_modules
rm -rf $TMPDIR/react-* --reset-cache
rm -rf node_modules/react-native/packager/packager.sh --reset-cache
npm cache clean
npm i
But I still experience the same problem
I have verified that react-native is in fact installed at the correct location.
Refer to this issue for a temporary workaround: #11498
The workaround does not fix the problem, we keep running into Unable to resolve module
RN 0.41
EDIT : all dependencies need to be declared / installed in react-native app directory, not in some parent directory, even if react-packager tells us he looks into others directories.
i have the same problem and the workaround does not fix mine :(. Any other suggestion ?
I am also facing the same issue after installing "npm install --save react-native-calendar-picker"
+1
+1 - i've gutted 2 projects now because of this, yikes
@wagstaffwm i resolve this by downgrading the React-Native can you please mention exactly which scenario you got this error..In my case my node module was corrupted..
I resolved this using the react-native-git-upgrade package instead of react-native upgrade to upgrade the project. And because of this I had to use yarn instead of npm.
So, i did something like that:
npm i -g react-native-git-upgrade
git clone https://github.com/ifalldev/repo
cd repo
yarn
yarn add [email protected]
yarn add [email protected]
react-native-git-upgrade
rnpm link
react-native run-ios
@ifalldev I am going to try to today I work another job during the day so it maybe tonight or later this week before I can report back thank you for the reply
I was able to resolve this issue with an earlier version of parse.
"parse": "~1.8.2"
I'm getting same error for "http" module! I tried all techniques mentioned at various places but nothing works. Any luck?
@prabakarviji, in my case I had to manually add [email protected] and [email protected] because the react-native-git-upgrade package crashes without it.
Can you bring a little more detail of your scenario?
I noticed this error probably occurs because of the incompatible versions of the packages.
After upgrading to react native 0.45.1 i have same issue.
What i did:
npm install --save [email protected]react-native upgradereact-native linkResult - Unable to find module React Native
+1
Using RN v44.2 and this is happening to me, the workaround isn't working either.
This issue is now intermittent for me. It's getting ridiculous though. I'll spend a while solving the issue, trying every available fix, only for it the problem to crop up shortly after.
The only thing that consistently works, even if it is very temporary, is to completely destroy the folder containing the RN project and clone the repo again. This allows me to work on the project until I need to download a new npm module or do an rm -rf node_modules && npm i.
Should I have to add a new npm module or update a package, I have to update it via the package.json, break the project, commit my changes, then cd .. && rm -rf project_name && git clone https://project-repo && cd project_name && git checkout current_working_branch && yarn install && yarn run-project-name.
Hope this helps someone in the meantime but a more permanent fix is urgently needed, this issue is seriously hampering my ability to get work done in a timely manner.
+1
Holy shit this sucks...
Actually found something. I was getting the same error and just now after my first comment I checked if I had yarn installed and which version. After hitting yarn -v it installed itself and all of the dependancies that were removed during my npm install --save firebase. After the install, in another terminal instance I re-ran npm run start which didn't have any issues then in the main terminal instance I ran react-native run-ios and that totally ran smoothly. When the problem (which this thread is about) was happening I couldn't run react-native run-ios because it didn't even recognize the root folder as a react-native file. Now it does. So give it a try. It doesn't seem like a quick fix, it seems stable now. Saying that we'll see how it goes... keeping a watchful eye.
@elvenvdk So far so good.
I am getting the below error. I have tried out the steps mentioned in the error console. But no luck.
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",

The development server returned response error code: 500
URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
Body:
{"from":"/Users/abc/development/react_native/node_modules/react-native-root-siblings/lib/AppRegistryInjection.js","to":"react-native/Libraries/EventEmitter/EventEmitter","message":"Unable to resolve module react-native/Libraries/EventEmitter/EventEmitter from /Users/abc/development/react_native/node_modules/react-native-root-siblings/lib/AppRegistryInjection.js: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]}
processBundleResult
BundleDownloader.java:170
access$100
BundleDownloader.java:39
onResponse
BundleDownloader.java:139
execute
RealCall.java:135
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1113
run
ThreadPoolExecutor.java:588
run
Thread.java:818
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
Followed @elvenvdk's advice. That error was silenced, but now I'm getting this error instead:

Along with this error when running react-native run-ios
** BUILD FAILED **
The following build commands failed:
CompileC build/Build/Intermediates.noindex/hail-react-native.build/Debug-iphonesimulator/hail-react-nativeTests.build/Objects-normal/x86_64/hail-react-nativeTests.o hail-react-nativeTests/hail-react-nativeTests.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I resolved this with this comment after trying every solution under the sun.
ios/ or android/react-native eject <-- this was what did it for mereact-native-git-upgradereact-native linkreact-native run-iosJust running react-native-git-upgrade in my project solved it for me. Even though it didn't update anything:
Dans-MacBook-Pro:the-resistance dwilt$ react-native-git-upgrade
git-upgrade info Check for updates
git-upgrade info Using yarn 1.3.2
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade info Check React peer dependency
git-upgrade info Check that Git is installed
git-upgrade info Get information from NPM registry
git-upgrade info Upgrading to React Native 0.52.2, React 16.2.0
git-upgrade info Setup temporary working directory
git-upgrade info Configure Git environment
git-upgrade info Init Git repository
git-upgrade info Add all files to commit
git-upgrade info Commit current project sources
git-upgrade info Create a tag before updating sources
git-upgrade info Generate old version template
git-upgrade info Add updated files to commit
git-upgrade info Commit old version template
git-upgrade info Install the new version
rm: ./node_modules/react-native/local-cli/core/fixtures/files/package.json: No such file or directory
git-upgrade info Generate new version template
git-upgrade info Add updated files to commit
git-upgrade info Commit new version template
git-upgrade info Generate the patch between the 2 versions
git-upgrade info Save the patch in temp directory
git-upgrade info Reset the 2 temporary commits
git-upgrade info Apply the patch
git-upgrade info Upgrade done
Dans-MacBook-Pro:the-resistance dwilt$
I just ran into this in a brand new project. Definitely not stale and none of the suggested actions change anything.
Also getting this error when trying to import a new package from node_modules.
Unable to resolve module "events"
I've tried all of the suggested fixes and none have worked for me... please help!
I had this problem too. When I ran "react-native start" it told me a bundler was already running on port 8081. It happened to be from Visual Studio Code. I closed this and ran the command "react-native start" and then the command "react-native run-ios". Seemed to fix the problem.
Most helpful comment
+1 - i've gutted 2 projects now because of this, yikes