You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that react-native is in fact installed at the correct location.
React Native version: 0.38.0
Platform: iOS
Operating System: MacOS
Reacted by Thibaut Fatus, Mohammed Mazil, John Gorenfeld, Balasubramanian.M, Abner Terribili, Andrea Bizzotto, Ian Packer, Fisayomi Ojuri, Harsha Goli and Anjum Nawab
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.
@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 react@16.0.0-alpha.6
yarn add react-native@0.43.3
react-native-git-upgrade
rnpm link
react-native run-ios
Reacted by John Gorenfeld, zhangdesheng and Ethan Xingyu Ji
@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
@prabakarviji, in my case I had to manually add react@16.0.0-alpha.6 and react-native@0.43.3 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.
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.
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.
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.
Just 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 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.
Activity
tedjames commentedon Jan 8, 2017
Refer to this issue for a temporary workaround: #11498
Thibaut-Fatus commentedon Feb 15, 2017
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.
nhuthuynh commentedon Feb 20, 2017
i have the same problem and the workaround does not fix mine :(. Any other suggestion ?
achakra21 commentedon Apr 9, 2017
I am also facing the same issue after installing "npm install --save react-native-calendar-picker"

ifalldev commentedon Apr 10, 2017
+1
wagstaffwm commentedon Apr 11, 2017
+1 - i've gutted 2 projects now because of this, yikes
achakra21 commentedon Apr 11, 2017
@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..
ifalldev commentedon Apr 11, 2017
I resolved this using the
react-native-git-upgradepackage instead ofreact-native upgradeto upgrade the project. And because of this I had to useyarninstead ofnpm.So, i did something like that:
wagstaffwm commentedon Apr 11, 2017
@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
DamienBell commentedon May 13, 2017
I was able to resolve this issue with an earlier version of parse.
"parse": "~1.8.2"
realpratiknikam commentedon May 28, 2017
I'm getting same error for "http" module! I tried all techniques mentioned at various places but nothing works. Any luck?
ifalldev commentedon May 30, 2017
@prabakarviji, in my case I had to manually add
react@16.0.0-alpha.6andreact-native@0.43.3because thereact-native-git-upgradepackage 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.
artyomtrityak commentedon Jun 26, 2017
After upgrading to react native 0.45.1 i have same issue.
What i did:
npm install --save react-native@0.45.1react-native upgradereact-native linkResult - Unable to find module React Native
Jahans3 commentedon Jul 4, 2017
+1
Using RN v44.2 and this is happening to me, the workaround isn't working either.
Jahans3 commentedon Jul 11, 2017
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.
elvenvdk commentedon Jul 11, 2017
+1
Holy shit this sucks...
elvenvdk commentedon Jul 11, 2017
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 -vit installed itself and all of the dependancies that were removed during mynpm install --save firebase. After the install, in another terminal instance I re-rannpm run startwhich didn't have any issues then in the main terminal instance I ranreact-native run-iosand that totally ran smoothly. When the problem (which this thread is about) was happening I couldn't runreact-native run-iosbecause 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.jestjosh commentedon Aug 10, 2017
@elvenvdk So far so good.
mukeshkamboj commentedon Sep 28, 2017
I am getting the below error. I have tried out the steps mentioned in the error console. But no luck.
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/EventEmitterfrom/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 thenode_modulesfolder:rm -rf node_modules && npm install.\n 3. Reset packager cache:rm -fr $TMPDIR/react-*ornpm 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
stale commentedon Nov 27, 2017
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.
arshbot commentedon Jan 3, 2018
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-iosarshbot commentedon Jan 3, 2018
I resolved this with this comment after trying every solution under the sun.
ios/orandroid/react-native eject<-- this was what did it for mereact-native-git-upgradereact-native linkreact-native run-iosdwilt commentedon Jan 27, 2018
Just running
react-native-git-upgradein my project solved it for me. Even though it didn't update anything:ShawnMercado commentedon Feb 17, 2018
I just ran into this in a brand new project. Definitely not stale and none of the suggested actions change anything.
astone123 commentedon Feb 21, 2018
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!
gamsim commentedon Mar 16, 2018
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.