react-native: UnableToResolveError: Unable to resolve module `AccessibilityInfo`

Description

I basically just cloned an existing project with a minimal setup, did yarn install and node node_modules/react-native/local-cli/cli.js run-ios. It started but the packer failed with:

error: bundling: UnableToResolveError: Unable to resolve module `AccessibilityInfo` from `/Users/phillipp/Work/***/***/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module does not exist in the module map or in these directories:
  /Users/phillipp/Work/***/***/node_modules/react-native/node_modules
,   /Users/phillipp/Work/***/***/node_modules

I found get AccessibilityInfo() { return require('AccessibilityInfo'); }, in the /Users/phillipp/Work/***/***/node_modules/react-native/Libraries/react-native/react-native-implementation.js file but I have no clue where it wants to require that from. It seems to be a RN core thing.

Here is the package.json for those who are curious:


{
  "name": "***",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "base64-js": "^1.2.0",
    "react": "^16.0.0-alpha.6",
    "react-native": "^0.44.0",
    "react-native-ble-manager": "^3.2.0",
    "react-native-checkbox": "^1.1.0",
    "react-native-color-picker": "^0.2.1",
    "react-native-drawer": "^2.3.0",
    "react-native-dropdown": "0.0.6",
    "react-native-image-picker": "^0.25.5",
    "react-native-list-popover": "^1.0.5",
    "react-native-modal-picker": "0.0.16",
    "react-native-orientation": "^1.17.0",
    "react-native-router-flux": "^3.37.0",
    "react-native-selectbox": "^0.1.0",
    "react-native-selection": "^1.3.5",
    "react-native-selectme": "^1.2.3",
    "react-native-sound": "^0.9.1",
    "react-native-vector-icons": "^4.0.1"
  },
  "devDependencies": {
    "babel-jest": "18.0.0",
    "babel-preset-react-native": "1.9.1",
    "jest": "18.1.0",
    "react-test-renderer": "~15.4.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

I already tried everything I found on the internet (reinstalling node modules, cleaning npm, yarn and watchman caches, deleting react files from temp dir, etc.)

Additional Information

  • React Native version: ^0.44.0
  • Platform: ios
  • Development Operating System: OSX
  • Dev tools: XCode Version 8.0 (8A218a)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 270
  • Comments: 321 (19 by maintainers)

Commits related to this issue

Most upvoted comments

sounds stupid but restart the computer might be the solution !

Please refrain from adding “me too” comments unless you’re providing additional details to aid with a repro. I suggest that instead you subscribe to the issue and add a reaction to the original post. Thanks!

@hramos I think people are just trying to express their sense of panic about issues like this 😃

I deleted my node_modules folder Then:

npm install
npm start -- --reset-cache

Fixed it for me.

Same here. Almost entire team stuck by this error.

It seems that this issue mostly affected bundler running on Windows. For me downgrade worked like this:

react-native init awesomeproject
npm remove --save react-native
npm i --save react-native@0.55.4

npm remove babel-preset-react-native
npm i --save babel-preset-react-native@2.1.0

I have the same problem. I have never in my life seen a project with so many problems like react native. HORROR!!!

This’s really bug on version 0.56

Does this still occur after deleting node_modules then running npm install?

I have no idea how this worked, and I have been scratching my head over how this worked, but I had other important work to get back to and let it be. But this is what I did,

react-native init ProjectName
react-native run-android

–gave the “AccessibilityInfo module not found” error–

npm uninstall react-native
npm install --save react-native@0.55.4
react-native run-android

–Error: Plugin 0 specified…–

npm install --save babel-core@latest babel-loader@latest

–Error: Plugin 0 specified…—

npm uninstall --save babel-preset-react-native
npm install --save babel-preset-react-native@4.0.0

And this started working fine My current dependencies:

{
  "name": "chartSamples",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-preset-react-native": "^4.0.0",
    "eslint-config-rallycoding": "^3.2.0",
    "react": "16.4.1",
    "react-native": "^0.55.4",
    "react-native-highcharts": "^1.0.2"
  },
  "devDependencies": {
    "babel-jest": "23.4.0",
    "jest": "23.4.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

Also try @lucienbl 's solution

react-native init ProjectName --version 0.55.4
react-native run-android

PS: @lucienbl 's solution also worked for me.

In fact, simpler test is this: new folder, npm install react-native@0.45.1, then open a console and run:

require('react-native').AccessibilityInfo
Error: Cannot find module 'AccessibilityInfo'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.get AccessibilityInfo [as AccessibilityInfo] (/Users/laika/x/node_modules/react-native/Libraries/react-native/react-native-implementation.js:19:36)
    at repl:1:24
    at ContextifyScript.Script.runInThisContext (vm.js:23:33)
    at REPLServer.defaultEval (repl.js:339:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)

Reproduced on multiple machines/environments.

@hramos Thanks your team work!

Yesterday, I use react-native-git-upgrade my project 0.44.0 to 0.44.1, it ok, perfect. but now, i use react-native-git-upgrade my project 0.44.1 to 0.44.2, same issue here.

I think issue in the react-native 0.44.1 upgrade to 0.44.2

Latest version 0.56.0 doesn’t work for me. I downgraded to @jerninvien 's config and app runs without any error.

"dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4"
  },
  "devDependencies": {
    "babel-jest": "22.4.4",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.4",
    "react-test-renderer": "16.3.1"
  }

It appears the issue has resurfaced in 0.54

I solved this issue easily by following the below steps,

  1. I copied dependencies and devDependencies of package.json file from another project that was working fine.
{
  "name": "NameOfYourProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4"
  },
  "devDependencies": {
    "babel-jest": "23.2.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.2.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}
  1. I deleted the node_modules folder from the main project folder

  2. Then, I re-installed node by, npm install --save react-native run-android

It will downgrade all the necessary dependencies including “react-native”. 😃

Doing this worked for me:

npm update
npm cache clean --force
rm -rf node_modules
yarn install

I’ve spent more time debugging this issue than writing code. Can we get an official response?

We finally got to the bottom of our situation, and it’s similar to what’s emerged in the cases of @nijolas and @pelotasplus: redundant node_modules / package.json in dependent packages.

In our case, we discovered issues with two packages, react-native-photos-framework and react-native-svg. In each of these there were incompatibilities being masked by the AccessibilityInfo exception.

In photos-framework, the lib was still using React’s PropTypes instead of the package prop-types, and was also using Babel preset latest. In svg lib, react-native is incorrectly listed as a dependency instead of peerDependency or devDependency. When your react-native package doesn’t match theirs, npm will create a node_modules with the different version within that dependency, and that’s when all hell breaks loose.

Here’s a PR for react-native-photos-framework: olofd/react-native-photos-framework#56

And react-native-svg already has a PR open: react-native-community/react-native-svg#360, or use my fork until that happens: https://github.com/sjmueller/react-native-svg

My best advice here is to look through all your dependencies for non-standard react-native/babel package.json setups. If you see a nested node_modules, you’ve probably found some problems.

I have found out the solution Follow the links and check out my comments to resolve ur problem https://stackoverflow.com/questions/48756550/unable-to-resolve-module-accessibilityinfo-when-trying-to-create-release-bund/51436043#51436043

I had again this popping up in 0.45.1. I fixed it with npm start-- --reset-cache

same here. But disappear when I use npm instead of yarn.

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

any news? It’s still happening with me on react-native 0.51.0 😕

keep calm and run yarn install babel-preset-react-native-stage-0 (npm install babel-preset-react-native-stage-0 if you are using npm)

react-native start -- --reset-cache react-native run-ios react-native run-android

This finally fixed the issue for me. Please confirm if it works for anyone else.

We’re now at 0.45, which does have its own issue (#14246). Let’s wait for #14246 to be fixed and then I’ll recommend you use 0.45.

I just hit this upgrading from 0.44.2 -> 0.44.3

Restart computer worked for me.

Same here

If you use yarn install instead of npm install, the error disappears

Try this: Delete both the $TMPDIR/react-* and the file $TMPDIR/haste-map-react-native-packager-*

$ rm -rf $TMPDIR/react-* && rm $TMPDIR/haste-map-react-native-packager-*

I guess the reason that it worked for some people by running with sudo is because it may use a different $TMPDIR and thus needs to recreates the haste-map… file.

same here. but after downgrading from 0.44.2 to 0.44.1 the issue vanished and everything is back to normal.

Now the other solution also worked for me:

react-native init ProjectName --version 0.55.4

but you need to set gradle version to 3.5.1 instead of 2.14.1

I think as a conclusion, this is a bug in react native 0.56 in Windows. You should use 0.55.4 with its last supported gradle which is gradle 3.5.1.

Now I can return to my work… 😃

React Native 0.56.0 is completely bugged so I suggest using 0.55.4 waiting for a new stable version 😃

Same issue on 0.52, worked for me with npm start – --reset-cache

I encountered this horrible problem too.

"react": "16.0.0-alpha.12",
 "react-native": "0.46.0",

I almost delete everything .npm .rncache node_modules … but also didn’t work

I was having similar issues running “react-native”: “0.44.0”. I deleted, and reinstalled my node modules, and also ran “killall -9 node” in my terminal and my project is running again.

same here

Using: “react”: “16.0.0-alpha.12”, “react-native”: “0.45.1”,

Starting the packager with --reset-cache flag seemed to help: node node_modules/react-native/local-cli/cli.js start --reset-cache

I have the same problem with 0.45.1

Same issue here. A project I created 2 days ago still works. A new project I created today with react-native init does not. In my case, the difference is the react-native version went from 0.44.0 to 0.44.2. On the new project, if I change the react-native version in package.json to 0.44.0, it works.

Still no solution for this issue?

getting same error with react-native: 0.56.0, after using react-native init NameOfProject

Guys, do not make thing so complicated…Restart the packager help me to fix this…

npm reinstall worked!

We encountered this issue when trying to use a file with a .jsx extension rather than a .js extension. Don’t know why or if this is a known thing with react-native, but changing back to a .js file resolved the issue. Might be worth trying if you’re pulling your hair out over this.

@LasithaPrabodha 's downgrade was only half of the solution for me, I had to also downgrade babel-preset-react-native

yarn remove babel-preset-react-native yarn add -D babel-preset-react-native@2.1.0

“killall -9 node” seems to resolve this issue.

React Native 0.54.0 Xcode 9.3

Computer restart helped

sudo react-native start fixed it for me on 0.54

For me the solution that worked was:

npm install react-native --save npm start – --reset-cache

hope this helps

Hey all,

Had this same issue on one of my client machines, but not my own.

Solution for me:

watchman watch-del-all

rm -rf node_modules && npm install

watchman watch-del-all

rm -rf node_modules && npm install

watchman watch-del-all

rm -rf node_modules && npm install

pod cache clean --all

BUT THEN BEFORE YOU REINSTALL:

Install node and npm to 7.6.0 and 4.1.2 respectively. This was on my machine but not the client’s. You can use n package manager (https://github.com/tj/n) to install 7.6.0 and npm install -g npm@4.1.2 to do the version changes.

Then do your normal npm install/pod install/clean/build dance.

This really work for me:

`npm uninstall babel-preset-react-native

npm install babel-preset-react-native@2.1.0`

react-native version: react-native-cli: 2.0.1 react-native: 0.48.3

@zdol I followed your steps. When I used the last command via copy/paste, it deleted everything in my project folder…

The problem for me was a missing dependency, but the AccessibilityInfo error was shown.

What I did to fix this:

Start the dev-server with --reset-cache and use this server for compilation.

Commands like react-native run-ios will start their own dev-server without --reset-cache, but use one that is already running.

So in one shell:

yarn start -- --reset-cache

In another one

yarn run ios

Then I got my real error in the first shell, yarn added my missing deps and everything worked.

RN 0.46.4 did not 😞

remove the “^” symbol in "react-native": "^0.45.1" and run npm install work for me

This is still present for me in 0.45.1. Same repro steps as everyone above.

same error on android

Esto funciono para mi : { "name": "demo21", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.3.1", "react-native": "0.55.4" }, "devDependencies": { "babel-jest": "22.4.1", "babel-preset-react-native": "4.0.0", "jest": "22.4.2", "react-test-renderer": "16.3.1" }, "jest": { "preset": "react-native" } }

It seems like a bug in 0.56 related to dependencies. The solution is to find the correct combination of dependencies. I don’t know how you did it. But, @ws7one you found that combination!! 👌👌

react-native >> 0.55.4
babel-core >> latest 
babel-loader >> latest
babel-preset-react-native >> 4.0.0

Otherwise, starting the project from the beginning with 0.55.4 give me gradle error …

 react-native init ProjectName --version 0.55.4

I don’t know if someone told that before me but downgrading from 0.56.0 to 0.55.4 solved this issue for me. 😃 @PrivateVoidMethod

@iamcc I just ran npm install react-native --save and it fixed it.

Also running

watchman watch-del-all

rm -rf node_modules && npm install

npm start --reset-cache

@johngoren I think the only special thing about AccessibilityInfo is that it’s the first module imported (they are sorted alphabetically in the file where it fails)

At the end it works for me ! Hooray ! 🙌 “react”: “^16.0.0-alpha.12”, “react-test-renderer”: “16.0.0-alpha.12”, “react-native”: “^0.47.1”,

I update all my SDK / JDK / Node / NPM / blablabla, did a cd android && gradlew clean and now it’s all good ! (I hope it will last…)

I think I’ve found the issue.

It seems to happen when there are duplicate modules that are imported. This happens most commonly when third party npms include Example projects. For example, in this NPM https://github.com/invertase/react-native-firebase there’s a directory example/demo.

You can manually delete these example folders in your node_modules as temporary workarounds, but the real solution is to patch the npms to no longer distribute the example projects.

I am really about to move a project I’ve being working on for months, form RN to Flutter. This is a waste of time. Such an incompetent language.

@ws7one , you need to do react-native init ProjectName --version 0.55.4 react-native run-android

This worked for me. 😃

This issue: react-native-implimentation.js AccessibilityInfo module not found react-native: 0.55.4 Only Re installing node_modules and reset cache does not fix this issue

After re installing node_modules Also run react-native link

I’m having this issue right now. Tried removing and re-installing node packages, restart the computer, cleaning cache… nothing seems to work.

@ujeenator Thanks: RN 0.55.3, fixed by restarting the computer. Cleaning NPM cache did not work for me.

npm cache clean --force worked for me

I deleted my node_modules folder

npm install npm start -- --reset-cache

Fixed it for me.

deleting the project folder and re-cloning it worked for me. Once I recloned the project, I ran

yarn
yarn cache clean
yarn start

I think it has been well established from the posts above, that this issue arises when a module has a dependency on another react-native version than your main project.

I have not tested yarn but as I suggested in a previous comment, completely removing those react-native folders works. Others have suggested a more painful approach: fork those offending modules and update their react-native dependency versions.

In any case, if it helps anyone, the delete react-native folders approach:

First: cd /path/to/yourproject

To show all folders named react-native :

find . -type d -name "react-native"

You don’t want to delete the node_modules/react-native folder of course. This command will show any folder named react-native, except node_modules/react-native itself:

find . -type d -name "react-native" -not -path "./node_modules/react-native" -not -path "./node_modules/react-native/*"

If you want to delete all those folders in one step:

find . -type d -name "react-native" -not -path "./node_modules/react-native" -not -path "./node_modules/react-native/*" | xargs rm -rf

If this fails, try yarn or start over with npm.

Bundling `index.android.js`  [development, non-minified, hmr disabled]  0.0% (0/1), failed.
error: bundling failed: "TransformError: D:\\***\\index.android.js:
 Cannot find module 'AccessibilityInfo'

Got this problem after an upgrade from 0.41.2 to 0.48.3, when I decided to eliminate the dependency to jest. In package.json, I deleted:

  "scripts": {
    "test": "jest",
  },
  "devDependencies": {
    "babel-jest": "18.0.0",
    "babel-preset-react-native": "1.9.1",
    "jest": "18.1.0",
    "react-test-renderer": "15.4.2"
  },
  "jest": {
    "preset": "react-native"
  }

Note: this would be the same as using the undocumented option: react-native init AwesomeProject --skip-jest

I had to restore one module: npm install --save-dev babel-preset-react-native Now I have:

  "devDependencies": {
    "babel-preset-react-native": "^4.0.0"
  }

Try to rename the project folder name. It works for me.

mv origin_project new_project

Just done an init and got this error.

Tried // first upgrade react-native $ react-native-git-upgrade

and // second upgrade dependencies $ yarn upgrade

As well as the usual reset cache etc and still get the Unable to resolve module AccessibilityInfo

@sjmueller is right. The incompatibility issues are masked by the AccessibilityInfo exception. For us, it was React Native SVG 5.2 that was required by react-native-pathjs-charts. Upgrading React Native SVG to 5.3 solves the issue.

If you are still experiencing this problem, try looking for dependencies that have RN SVG 5.2. If you still couldn’t find the problem, try deleting some dependencies and run the following command until you find the culprit.

watchman watch-del-all && rm -rf node_modules && npm install && rm -fr $TMPDIR/react-* && npm start – --reset-cache

I am not a geek - but can anyone please state what helped to resolve this issue? I tried out:

  1. watchman watch-del-all
  2. rm -rf node_modules && npm install
  3. npm start-- --reset-cache

I am running on react-native 0.44.3

I would be delighted to learn how to solve this issue. many thanks // simone

Anyone here tried Native Script for Vue…? I’m thinking to convert my projects to Native Script - Vue because React Native is throwing all kinds of errors that I’ve never seen before. Any suggestion would be very much appriciated.

I’d like to say that I solved this issue by switching to yarn. I didn’t encounter this issue since the switch (1 year ago, you can see one of my post in the beginning of this thread)

Even today If I save a dependency using npm by mistake it will delete some dependency and the project will now longer build due to X module being not here

@sideroff downgrading react native and babel also worked for me

Is there a solution without downgrading from 0.56.0?

react-native:0.55.4

react-native run-ios , there are some problem about AccessibilityInfo。 how to fix this issue? I need help.

error: bundling failed: Error: Cannot find module 'AccessibilityInfo' (While processing preset: "/Users/chen/ReactNative/ProgramKids1/node_modules/react-native/Libraries/react-native/react-native-implementation.js")
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.get AccessibilityInfo [as AccessibilityInfo] (/Users/chen/ReactNative/ProgramKids1/node_modules/react-native/Libraries/react-native/react-native-implementation.js:17:36)
    at /Users/chen/ReactNative/ProgramKids1/node_modules/lodash/_baseClone.js:145:23
    at arrayEach (/Users/chen/ReactNative/ProgramKids1/node_modules/lodash/_arrayEach.js:15:9)
    at baseClone (/Users/chen/ReactNative/ProgramKids1/node_modules/lodash/_baseClone.js:142:3)
    at cloneDeepWith (/Users/chen/ReactNative/ProgramKids1/node_modules/lodash/cloneDeepWith.js:37:10)
 BUNDLE  [ios, dev] ./index.ios.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.

So basically what always works for me is:

  1. remove the node_modules folder
  2. restart the mac
  3. run yarn install to fetch the packages
  4. start the bundler with --reset-cache
  5. npm run-android or npm run-ios

I think that it would be nice if it is fixed at some point.

Instead of react-native run-android, I use node node_modules/react-native/local-cli/cli.js run-android and it works.

I tried everything mentioned in this thread. Nothing worked. I commited everything, then I cloned the project on a new folder and everything worked. Don’t ask me why.

for anyone who came here using react-native-web lib default alias via react-native-web/babel didn’t work for me and I had to add alias myself

alias: {
  'react-native': 'react-native-web',
  'react-router-native': 'react-router',
},

This can be reproduced by installing react-native with npm after running react-native init from the project directory. We encountered it with OSX, node 8.7.0, iOS in the js-xlsx react-native demo:

git clone --depth 1 https://github.com/SheetJS/js-xlsx/
cd js-xlsx/demos/react/
make ios

This builds up a new project and uses npm install for deps:

# ...
react-native init SheetJS
cd SheetJS
npm i -S xlsx react react-native react-native-table-component react-native-fs
# ...

After some repeated tests with fresh clones and installs, here’s what we found:

Version Result
4.3.0 PASS
5.0.4 FAIL
5.1.0 FAIL
5.2.0 FAIL
5.3.0 FAIL
5.4.0 FAIL
5.4.2 FAIL
5.5.0 FAIL
5.5.1 FAIL
yarn! PASS

Avoiding npm entirely (replace npm i -S with yarn add) works and is likely the best approach.

More generally, 4.3.0 is the last version where we haven’t had any major issues with npm. We usually explicitly roll back when switching node versions using a command like sudo npm install -g npm@4.3.x.

I found that mismatched devDependencies are making this happen. for example, using react@16.0.0-beta.5 for react-native@0.47.1, then react-test-renderer is installing react@16.0.0-alpha.12 and another dependency is installing react@16.0.0-alpha.6 (not sure which). you can force to always use the latest react beta by doing removing the extra react versions returned by npm ls --depth=10 | grep react@

I have this problem with the 0.47.0 and 0.47.1 any update ?

I delete node_modules

watchman watch-del-all rm -rf ./node_modules rm -rf $TMPDIR/react-*

And nothing works

i got this problem but now ok after few try of the following steps

  1. remove the node_module folder
  2. “npm install”
  3. “cd android” then “./gradlew clean”
  4. “npm start – --clear cache”
  5. rebuild

my dependencies

   "dependencies": {
	"react": "16.0.0-alpha.12",
	"react-native": "0.45.1",
	"react-native-button": "^2.0.0",
	"react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
	"react-native-camera-roll-picker": "^1.1.9",
	"react-native-maps": "0.15.0",
	"react-native-responsive-image": "^2.1.0",
	"react-navigation": "git+https://github.com/react-community/react-navigation.git"
  },
  "devDependencies": {
	"babel-jest": "20.0.3",
	"babel-preset-react-native": "2.0.0",
	"jest": "20.0.4",
	"react-test-renderer": "16.0.0-alpha.12"
  },
  "jest": {
	"preset": "react-native"
  }

I just hit this again upgrading from 0.45.1 -> 0.46.0. Seems every time I upgrade this creeps back in, and I’m not sure which of these magic tricks get it to go away.

  • Resetting watchman:
watchman watch-del-all
  • Reinstalling modules:
rm -rf node_modules/
yarn
  • Clearing the packager cache:
rm -fr $TMPDIR/react-*
  • Cleaning the XCode project

  • Restarting OSX (I know it sounds dumb, but this literally solved it in the past…).

Usually some combination of the above eventually resolve the issue, but none are working so far for me on the new 0.46.0 release.

It would seem that this has become the default catch all for any uncaught packager error / exception. Did we lose an error catching class or a try catch somewhere in the most recent release of RN?

After installing react-native-fetch-blob (nb. nothing to do with the issue at matter) the problem pop up again. Cleaning tmp, reseting cache, removing node_modules are npm install had no effect. The issue persisted. Then I tried the good-old MS Windows cure for all: restart my laptop (it’s a Mac) ant the issue vanished. So if you run out of options, this might help. I sure did for me.

The other suggested solutions didn’t work for me, but this did for

“react”: “^16.0.0-alpha.12”, “react-native”: “^0.45.1”,

  • - npm install npm@latest -g
  • - npm cache clean
  • - npm uninstall react-native-cli -g
  • - npm install react-native-cli -g

When I create a new project with react-native init (RN 0.45.1) I do not have the problem, but on my project 0.45.1 I still have it. It does not matter whether I clean the project, empty cache, use NPM instead of Yarn, remove node_modules.

Any idea?

I just hit ‘react-native init’ and then ‘react-native run-ios’ and upon launching the simulator I see the well-known error message : ‘cannot find module AccessibilyInfo’

version: on macOS Sierra, react-native 0.45.1

I wish I could help, keep up the good work !

edit : I just deleted the line that required this module, now everything works just fine : Noob fix 🙃

change it to “react-native”: “0.44.0”, delete react-native and install again.

Thakns @ne0fite

same here, any solutions?

Why is still closed this issue? No one resolved it yet, all are complaining about this problem. How we resolve it?! I already lost a day of work… I dont understand why its closed.

is there any advance on this? I don’t know what to do because if I downgrade react-native to 0.55.4 I get stuck by the issue 19126 and if I stay in 0.56 I cannot compile, run on emulator or do anything and the fixes to the issue 19126 doesn’t work for me

The bundling eventually, was successful for me, but vulnerabilities came along with it, suggesting I run npm install react-native @0.56.0 which will take me back to the same problem. Also, I’m getting package.json schemastore errors.

@ws7one Have you downgraded babel-preset-react-native to 4?
I face this problem too but it work well after downgrade to babel-preset-react-native@4.

I had to use npm instead of yarn.

We typically use yarn for all of our commands but we were running into this issue.

However, when I use npm install it works just fine:

rm -rf node_modules/
npm install
npm start -- --reset-cache

There must be something with how yarn handles dependencies differently than npm.

"react-native": "0.47.2"

I have a fairly non-standard build setup, so non of the standard responses to this have been working for me. However I have been able to trace the issue to third party libraries including .babelrc files. Once the bundler hits these, it can’t find react-native anymore and fails. Deleting them seems to work so far.

This happens due to mismatch between eslint-preset versions that react-native uses and your app uses. There may be other dependencies too that have this mismatch. If you simply do npm update (if the dependency list is not huge) or selectively update “safe-to-update” dependencies, and then try bundling, this error should go away

npm update
rm -rf node_modules
npm install --reset-cache
npm run bundle (or react-native bundle <options>)

There seems to be a lot of issues surrounding NPM lately.

I did: yarn yarn cache clean yarn start

and I also killed everything running on the port the emulator wanted to run on.

That worked.

I guess I have same error:

error: bundling failed: “Unable to resolve module ‘ActivityIndicator’ from '…\react-native-implemenation.js”

I tried any solution on this thread and in other threads in the web, without solveing it.

  • cleaned the cache
  • deleted node_modules folder
  • used npm and/or yarn

Nothing worked. React-native seems so cool, but it is so damn unstable.

I verified the last known working version is react 0.46.4 in regards to this issue. I kept reproducing from 0.47.0, 0.47.1 and 0.47.2 and tried Node 7.6, 8.3, 8.4 with same behavior regardless of npm.

I highly recommend using rninit over react-native as it is like using nvm over homebrew and allows you to quickly test (relative to the alternative) which version is OK.

Just curious if anyone is able to build 0.47.2 without this error? I cannot, not even with a new project. I get the AccessibilityInfo error every time. And yet I can see AccessibilityInfo in node_modules/react-native/Libraries/Components/AccessibilityInfo. Why is it not finding this file?

Has anyone who works on the project noticed this issue? Seems like a critical stopper to me.

I’ve been using 0.44.1 for months now. Any version higher simply doesn’t work. I know Facebook declared RN “production ready” a while ago (https://facebook.github.io/react/blog/2014/03/28/the-road-to-1.0.html) but I think the lack of a 1.0 version proves that this may be an optimistic statement.

If you MUST use React Native and need to get past this error, I recommend:

“react”: “16.0.0-alpha.6”, “react-native”: “0.44.1”

(and a fifth of whiskey)

This happens when some module (in my case react-native-router-flux) installs a different react-native version in its own node_modules folder.

First, I tried the nuclear option, just to be safe: watchman watch-del-all && rm -rf node_modules && npm install && rm -fr $TMPDIR/react-* && npm start -- --reset-cache

Upon running the packager, a stream of errors indicated something was still wrong. e.g.:

Loading dependency graph... jest-haste-map: @providesModule naming collision: Duplicate module name: ReactUpdateQueue

I searched for ReactUpdateQueue in my node_modules folder, and found which module had extra react-native installations in its own node_modules.

So, finally, I deleted react-native folder from node_modules\react-native-router-flux\node_modules which fixed the issue (until i decide to upgrade my various modules.)

Man, I hate upgrading. I shouldn’t have to bill the client for so many hours doing this, but I will.

I’m currently using "react-native": "0.46.1", since I encoutered this bug I switched to yarn and since then I’m no longer encoutering problems. It may or may not be linked to npm even though some currently npm5 issue are related to deleted dependencies during an install process.

sudo react-native start Then react-native run-ios || run-android 👍

Having same issue with “http” module. I’m on v0.44.0

@RohanVB, @sirgalleto moving to 0.44.1 is ok, if you have trouble with 0.44.0.

@gluons thx, they didnt make it work, but at least we know now that they cant in this version and it will be fixed in 0.57. Thx.

I abandoned RN for Xamarin Forms 3 weeks ago, this was the final straw for me

Downgrading to babel-preset-react-native@2.1.0 worked for me!

I think the solution actually is to reset your dev machine, clearing cache and rerunning the project afresh.

Try any or two of the following

Solution 1. A simple way to do this is to restart your computer.

Solution 2 Delete your node modules folder close terminals running your nodejs server and run killall -9 node after that run npm install --reset-cache and that’s it.

Hopefully after this you’re good to go.

Hello everyone,

I’ve reproduced the test of @ryanmcgrath :

$> node
> let rn = require('react-native').AccessibilityInfo
Error: Cannot find module 'AccessibilityInfo'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.get AccessibilityInfo [as AccessibilityInfo] (/Users/godefroy/Go/src/github.com/united-drivers/wulo/native/node_modules/react-native/Libraries/react-native/react-native-implementation.js:19:36)

then, i tried to see all keys of react-native object :

$> node
> let rn = require('react-native')
undefined
> rn
{ AccessibilityInfo: [Getter],
  ActivityIndicator: [Getter],
  ART: [Getter],
  Button: [Getter],
 ...
}

So, the keys are there.

The problem is that require(‘AccessibilityInfo’) can’t access to module.exports in ./node_modules/react-native/Libraries/react-native/react-native-implementation.js

$> node --version
v9.5.0

react-native version : 0.53.3

In my case, this error is thrown only on iOS.

I am getting the same error, tried all solutions mentioned above, nothing is working 😦, I am frustrated now. Please help me to get out of this error please…

Its work!

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

Clearing npm cache and rm -rf ~/.npm solved this issue for me.

ah ok thanks, will give it try. the scariest bit is that this seems to happen without a reason (yes, there’s always a reason, but it’s hard to see what in this case, which sort of reduces one’s confidence in the tool)

try installing react native on top of your existing react native (don’t delete the existing one)

npm install react-native --save

This is quite annoying. Every now and then without any obvious reason this happens. And now, NONE of the known fixes (delete everything, reinstall, clear cache, etc) help. Ok, one thing I haven’t tried besided reinstalling Mac, is cloning the project, which I will do. Sorry for ranting please treat it as an upvote on this issue, it’s been happening for quite a while…

After trying AAAAAAALL of the above solutions (none of which worked), I found out that for me the issue was caused because of the following line of code on iOS:

jsCodeLocation = [NSURL URLWithString:@"http://192.168.192.40:8081/index.bundle"];

I was using that to remote debug a device on a different network. When I changed the above line to the default:

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@“index” fallbackResource:nil];

the problem was gone.

@wittjosiah thanks man. i read this whole thread and turns out the last comment (yours) is what does it!

Hi. I thought I’d say that the only time I get this error is when I try to use this particular package: https://github.com/tongyy/react-native-draggable

Since you guys were having so much trouble tracking this down, and I’d actually really like to use this particular package, I thought I’d throw it out there. Not only does installing this package give me the same error, but it also keeps it broken whether I clear/reset cache, restart computer, delete node_modules, etc etc basically everything discussed in this thread other than simply restarting another react-native project from scratch.

Good luck!

PS - I’m not using babel PPS - I’m not using react-native-router-flux

We just had crashing with Accessibilityinfo reoccur on 48.1. Apparently upgrading to babel-preset-react-native to 3.0.2 would cause the error. If we downgraded to what we had previously (2.1.0) we do not get the error.

For those that don’t want to use yarn

Had to go through my modules to look for modules that weren’t using a react or react-native or react-renderer, fork them, and change the package versions to match my project and it works.

I use the version 0.46.1 and I change the version to 0.46.0.It works

Just did the same as @sidious18 (deleted my project folder, cloned it from github, built it again) and the bug still there. I’ve tried all steps and nothing works. Quite sad 😕

Crazy thing is that this issue exists since May 26. Sounds like every version brings it back…

Have no idea why it helped, but I deleted my project folder, cloned it from github, built it again and that’s it - bug has gone. This RN magic makes me crazy.

Omg… @amoa400 's method (renaming the project folder) works! I can’t believe!

Didn’t updated my react-native to latest version. Mine is still 0.45.1

watchman watch-del-all
rm -rf ./node_modules
yarn cache clean     // if you are using yarn 
rm -rf $TMPDIR/react-*

RESTART MACHINE

npm install
react-native link

Worked !! 😃

and it did magically resolved itself… wow, determinism is strong in this one

Lo and behold. Same commands and code started working today as well, and while I see some dependencies changed, they don’t seem relevant.

This problem vanished for me like magic when I changed the machine from an Ubuntu server to my local Mac. Don’t know the reason at all. Version of node is on both machines 6.11.2, npm 3.10.10.

Thanks, @HilSny, I’ll check

I have spent 4 hours trying and searching solutions… no result It’s headache😞, courage react native team

Facebook Employees, Please Help

The problem is obviously some issues with third party modules. But what exactly is the conflict? I’d happily patch these modules that I want to use if I knew what the issue was.

For me answer from @ricardosasilva done the job! Removing haste-map was the trick! Thank you!

I’m stuck on this for almost 2 days now. Reverted to 0.41.2 which was working for me before. None of the mentioned versions like 0.44.x worked.

I use @ywongweb 's solution and resolve this issue, just upgrade all dependencies and it works.

// first upgrade react-native
$ react-native-git-upgrade
// second upgrade dependencies
$ yarn upgrade

I have tried all possible suggestions from this thread but nothing worked for me. Although the solution that worked was to clone my project into a different folder name and reinstall everything. For some reason there must be some caching on my mac that the commands above don’t clean that has the name of my project somewhere… (even restarting and reinstalling yarn/node didn’t work)

The only thing that changed for me was it worked when running react-native start with sudo

I encountered this bug 😭 I’m currently using these versions

	"react": "^16.0.0-alpha.12",
	"react-native": "^0.45.1",
	"react-native-cli": "^2.0.1"

In my case the packager instance was also giving me warnings:

“This warning is caused by a @providesModule declaration with the same name across two different files”.

Another symptom was that editing the require('AccessibilityInfo') statement to a correct, local path of require('../Components/AccessibilityInfo/AccessibilityInfo') in react-native-implementation.js caused the error to fall onto the next line, saying:

“Unable to resolve module ‘ActivityIndicator’”

So, in my case, I had installed react-native-paypal in my project. There was an example project in this module with its own package.json - in which I had run npm install, and react-native had also been included under its node_modules folder, e.g.:

/my_project/node_modules/**react-native** /my_project/node_modules/react-native-paypal/ios/Example/node_modules/**react-native**

Deleting that deeper node_modules folder corrected this issue for me.

Hope it helps someone.

I got the same problem. When you finish rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build/ModuleCache/* && rm -rf node_modules/ && yarn cache clean && yarn

And run react-native link I got `RNFetchBlob checking app version … RNFetchBlob detected app version => 0.44 Add Android permissions => false react-native-fetch-blob will not automatically add Android permissions after 0.9.4 please run the following command if you want to add default permissions :

RNFB_ANDROID_PERMISSIONS=true react-native link 

`

Just try RNFB_ANDROID_PERMISSIONS=true react-native link It fix on me.

This one is killing us too. 28 days and 62 responses later, does @javache or @davidaurelio have a response or eta on a fix? Fingers x’ed that 0.9 facebook/metro-bundler@b62669e released an hour ago somehow helps…

I got this issue running it on linux/android/npm when trying to create a new RN project in a subfolder of a module project and trying to access the library by file:../.

Edit: Finally when doing a fresh react-native init ended up working.

Edit 2: I think it is because react-native is twice in the dependency tree, this could happen because some given dependency of your project is not using it as a peer, but just thinking out load.

I am getting this still after following all this advice. Tried the react-native-git-upgrade.

I am using these versions:

    "react": "^16.0.0-alpha.12",
    "react-native": "^0.45.1",

any ideas? It seems to have just started happening.

@brendan-rius I have the same issue than you, not matter what, the error persist, BUT, I cleaned the project and make the upgrade using react-native-git-upgrade and magically everything start working and the error is gone 😕

Check it out react-native-git-upgrade

ps: I’m using react-native@0.45.1

I fixed it by using the latest version of npm@5.0.3 and node@latest … I don’t know why but now react-native init works …

This is still reproduced for me in 0.45.1 I can’t react-native init NewProject, I use it with cocoapods in my old project.

versions: react-native-cli: 2.0.1 react-native: 0.45.1 yarn:0.24.5 macOS Sierra, Xcode 8.3.2

This does not reproduce for me on a brand new project. I’ve tried:

react-native init Test
cd Test
react-native run-ios

react-native version: 0.45.1 yarn version: 0.24.3 macOS Sierra, Xcode 8.3.3

I’ve also upgraded an older project that was using 0.42 to use 0.45.1, and was not able to reproduce the issue.

This just happened to me and it was because I had a hung ‘node’ process on port 8081, preventing a new instance of react packager from starting. I did killall -9 node and then was fine.