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

Created on 26 May 2017  ·  321Comments  ·  Source: facebook/react-native

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)
Ran Commands Locked

Most helpful comment

sounds stupid but restart the computer might be the solution !

All 321 comments

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.

Same issue suddenly after runing init... :-(

Same issue here

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

@hramos
I tried removing node_modules and reinstalling and it does not work.

@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

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

same here.

same error on android

same on android, removing node_modules and reinstalling and it does not work

Same here. Almost entire team stuck by this error.

Same here

same here, any solutions?

same here

I've downgraded to v 0.44.0 and everything it's working well.

@sirgalleto I'm not sure if downgrading to v0.44.0 would be the solution, since that's the version which @PhillippOhlandt is using. I'm pretty sure it could be something along these lines: https://github.com/aksonov/react-native-router-flux/issues/1904 which would just involve changing the requirements on the react-native-router-flux package.

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

@valinaga I don't think it's an issue with the react-native package version, it's with react.
The support for router-flux doesn't extend to 16.0.0-alpha.6 at the moment.

Having same issue with "http" module. I'm on v0.44.0

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!

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

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

I just hit this upgrading from 0.44.2 -> 0.44.3

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.

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

Thakns @ne0fite

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 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.

sounds stupid but restart the computer might be the solution !

I changed the version and now it came back working may be a problem in the version, I went back to "0.44.0" and it worked again

0.45.1 is now available. Can you check if this is still reproduced in 0.45.1?

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

In fact, simpler test is this: new folder, npm install [email protected], 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.

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 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

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 🙃

I deleted my node_modules folder
Then:

npm install
npm start -- --reset-cache

Fixed it for me.

I fixed it by using the latest version of [email protected] and node@latest ... I don't know why but now react-native init works ...

I think it might be related to this npm issue
https://github.com/npm/npm/issues/16839#issuecomment-308809150

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

@skalbfell I deleted this line as @MehdiAlouafi pointed out and it works

When I deleted it the first time it works but the second time (after
installing another dependencie I believe) the app throws the exact same
error but.. with the required package on the next line !

I really think this is an npm issue, a simple npm install
react-native@latest afterwards makes everything works again

--
Mehdi AL OUAFI
Front-End Developer Junior

Paris, France

Portfolio http://mehdialouafi.github.io/Portfolio/ - Behance
https://www.behance.net/MehdiAlouafi/ - Twitter
https://twitter.com/AMehdiW - LinkedIn
https://fr.linkedin.com/in/mehdi-alouafi-440529116

Ok great. It is definitely an issue with the version 0.44.2
If you downgrade to 0.44.0 it works back again.

Many thanks! // simone

I have the same problem with 0.45.1

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

+1

And same with 0.44.3 (I cleaned the project, removed node_modules, removed watchman watches, and emptied cache)

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?

@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 :confused:

Check it out react-native-git-upgrade

_ps_: I'm using [email protected]

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.

Can you look up through your npm modules folder, the react-native dir is
empty ?
Mine was empty after installing one node modules using npm

If it is empty try to run npm install --save react-native@latest, it solved
lt for me

Thanks @MehdiAlouafi . Mine looks fine though:

ls node_modules/react-native/Libraries/react-native
React.js  react-native-implementation.js  react-native-interface.js

Our team had build fails up until we downgraded babel-preset-react-native from 2.0.0 to 1.9.1. Could be an issue with version 2.0.0 of babel-preset-react-native and not with RN as a whole.

Currently we are using:

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

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

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

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.

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

Having the same issue. New install as well as existing.
Works for Mac running the iOS version.
On Windows with Android I get:
error: bundling: UnableToResolveError: Unable to resolve module AccessibilityInfo

I have tried every example from above.
Removing and uninstalling node / npm.
Removing the node_modules and re-installing.
Starting with reset-cache

Nothing. I can't seem to get rid of the error on Windows + Android.

Using:
npm: '3.10.10',
node: '6.11.0',
react: '16.0.0-alpha.12',
react-native: '0.45.1'

Any ideas on what I could try next? Would be really appreciated. Running out of ideas.

I had the same error today, and if i ran the react-native packager manually with

npm run start -- --reset-cache

and when i load the bundle, it displayed

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
Duplicate module name: AccessibilityInfo
Paths: project/ios/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js collides with project/node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js

and a lot of same errors with other native modules, so i just had to delete the Libraries folder in ios, restart all and it's ok for me now

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.

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...

@nico2che have you had any ill affect on deleting the Libraries folder? I have packages like react-native-navigation installed. Would that be affected by deleting this? Or does it just get re-built?

Also this isn't affecting my Mac + iOS build. It works perfectly. This is when I try and spin up Android on Windows 10.

FYI:
On OS X, I only encounter this issue when I run the packager as "npm start --clear-cache".
If I remove the --clear-cache argument, the project code runs fine.

Just tried and confirmed.
On Windows running Android it still shows the error with or without --clear-cache / --reset-cache using npm start.

Thanks for the idea though.

@ianataffinity Since you are using Windows 10, have you tried doing a build of your Project using https://mobile.azure.com ? (it's currently free, so no cost would be incurred). I ask because I've found their logging output to be much more helpful then the stock red screen of react-native.

I fixed it just by rename my js file from 'index.js' to 'index.ios.js'. And then the error gone when load http://localhost:8081/index.ios.bundle

@nandesu Thanks for the heads up on that one. Mobile Azure is pretty nice.
I have integrated it successfully, however none of the crash reports are coming through. I seem to be just getting the red screen with the Unable to resolve module AccessibilityInfo error on it.

Maybe there is a waiting time before it shows up, I'm not sure.

I was getting the same error as @nico2che, but his suggested solution did not solve the problem for me. Instead I reinstalled node and npm via homebrew and that somehow fixed the problem completely.

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?

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.

What I spent some time doing is opening the Android app in Android Studio and going through syncing the Gradle files with the project and one by one fixing any errors that arose from the build.

This included miss managed linking projects, when using react-native link and general exceptions.

Once I got the build correct, I booted it up in debug mode, connected it to my Genymotion instance and then ran 'npm start' so it could find the packager.

That seemed to have got it all working for me.

had the same problem and in my case i had two package.json files one in root directory and another in android/. Also somehow managed to install two set of node modules -- had node_modules/ and android/node_modules directories. my fix was to just remove android/package.json and android/node_modules

For me, "yarn install" did not work, what I did was is:

rm -fr node_modules/
npm install

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.

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 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"

@DevHossamHassan you shouldn't use '^' partial version here, because alpha :

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

Damn it! Anybody who knows how to solve this shit?
"react": "16.0.0-alpha.12", "react-native": "0.45.1",

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 have one working version of the node_modules folder and one that's not working. The working one is older (updated from earlier versions), while the other one is newly fetched.

I ran diff --brief -r node_modules node_modules2
node_modules is the non-working
node_modules2 is the working one
Here's the output (219 lines):
https://pastebin.com/BjACU7fT

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.

I've been struggling with this all day and I finally got something working. I found this while following this thread https://github.com/facebook/react-native/issues/14843, although I'm using react-native 0.45.1 and have basically a fresh app with a single dependency.

I don't know why, but installing babel-plugin-idx fixed this problem for me.

Steps

First install the plugin:

yarn add babel-plugin-idx

Then update .babelrc:

{
  "presets": ["react-native"],
  "plugins": ["idx"]
}

Finally, start the app

react-native run-ios

Background

I'm actually making a generator that creates new react-native apps with an internal library as a dependency, and upon adding this library I get the error above. Only by adding this plugin am I able to proceed using my internal library. It's only JS, no native code, and there are no dependencies, only devDependencies and peerDependencies, so the node_modules for that winds up being empty.

I found this solution because I noticed that sometimes I was actually seeing TRANSFORM ERROR: UnableToResolveError: ..., which led me down the babelrc path. It seems like there's some issue with babel and peer requirements of react and/or react-native, or some other dependency, but I'm not entirely sure. At least for now I have a reproducible, stable build with 0.45.1 using this idx plugin.

Additional Information

  • React Native version: ^0.45.1
  • Platform: ios
  • Development Operating System: OSX

Im trying to upgrade to 0.46 from 0.43.3 but keep getting this error. Iv gone through all my libraries and they look fine to me, as for have putting the peerDependecies right and everything. I also did a find in my node_modules: find node_modules -name "react-native*" and that didnt show me any packages that was not already OK! This bug is starting to annoy me, I would love to get things upgraded!

My dependecies are here:

  "dependencies": {
    "@mapbox/polyline": "^0.2.0",    
    "axios": "^0.15.3",    
    "babel-plugin-transform-decorators-legacy": "^1.3.4",    
    "better-npm-run": "0.0.14",    
    "moment": "^2.18.1",    
    "native-base": "^2.2.0",     
    "react": "16.0.0-alpha.4",
    "react-native": "^0.46",
    "react-native-easy-grid": "0.1.13",
    "react-native-fabric": "^0.4.1",
    "react-native-maps": "^0.15.3",
    "react-native-vector-icons": "~4.1.1",
    "react-navigation": "^1.0.0-beta.11",
    "react-redux": "^5.0.3",
    "react-router-redux": "^4.0.8",
    "redux": "^3.6.0",
    "redux-devtools-extension": "^2.13.0",
    "redux-logger": "^2.8.2",
    "redux-saga": "^0.14.3",
    "stacktrace-js": "^2.0.0",
    "url-parse": "^1.1.9"
  }, 
  "devDependencies": {
    "babel-eslint": "^7.2.3",
    "babel-jest": "18.0.0",
    "babel-plugin-module-resolver": "^2.7.0",
    "babel-preset-react-native": "^2.0.0",
    "eslint": "^3.19.0",
    "eslint-config-airbnb": "^14.1.0",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-react": "^7.0.1",
    "eslint-watch": "^3.1.0",
    "jest": "18.1.0",
    "jsx-control-statements": "^3.2.5",
    "react-test-renderer": "15.4.2",
    "reactotron-react-native": "^1.10.0",
    "reactotron-redux": "^1.10.0",
    "reactotron-redux-saga": "^1.10.0",
    "source-map": "^0.5.6",
    "wml": "0.0.82"
  },
  "jest": {
    "preset": "react-native"
  }

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"
  }

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

@jmullings similar worked for me by running:
sudo npm start
react-native run-ios

It seemed that the node packager was causing issues?

Just a noob but it worked for me.

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

I'm on windows so cannot run with sudo. i run console with administrator

today i have this error too

Loading dependency graph, done.
error: bundling: UnableToResolveError: Unable to resolve module `AccessibilityInfo` from `D:\iosReactTest2\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: Module does not exist in the module map or in these directories: D:\iosReactTest2\node_modules\react-native\node_modules,   D:\iosReactTest2\node_modules

I tried the solutions above but nothing work ...
My package.json

{
  "name": "iosReactTest2",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "native-base": "^2.2.1",
    "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-material-ui": "^1.12.0",
    "react-native-responsive-image": "^2.1.0",
    "react-native-side-menu": "^0.20.3",
    "react-native-vector-icons": "^4.2.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"
  }
}

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.

Everytime I did a react-native init and then npm install some dependencies I encountered this bug. I just tried to switch to using yarn add instead and now everything works fine.

At some point some solutions described above worked for me (the rm .babelrc one for example) but it was always triggered by a npm install .

I think it's a problem with npm... my clear-all scripts for windows:

"reset1": "rimraf \"%userprofile%/AppData/Roaming/npm-cache/*\""
"reset2": "rimraf \"%userprofile%/AppData/Local/Temp/react-*\""
"reset3": "rimraf \"%userprofile%/AppData/Local/Temp/npm-*\""
"reset4": "rimraf node_modules"
"reset5": "npm cache clean"
"reset6": "npm i"
"reset7": "node node_modules/react-native/local-cli/cli.js start --reset-cache"

"test-exp-start": "exp start --clear"

@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 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)

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.

@kensongoo Perhaps we could compile a list of dependencies that are confirmed to have this problem. I don't see react-native-svg in my node_modules, and I'm looking in my dependencies for the suspect with no luck so far...though any tips on how to identify bad ones would be much appreciated. Or maybe a script that identifies bad ones?

@ricardosasilva 's solution didn't work for me. I have a shell script of @kensongoo 's solution that I run every time there's the crash. Under the newest stable release of React Native, 0.46.3, this bug seems to hit me every 15-20 minutes, slowing development to sub-Java speeds.

I managed to fixed my project by upgrading the dependencies one by one to the latest versions until it works. For me the culprit is the router.

The steps are
yarn upgrade someLib
clean everything
build
rinse and repeat

edit: You might need to remove the ^ mark from your library dependencies so you are installing the Exact Versions i.e. someLib: ^0.5.1 -> someLib: 0.5.1

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

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

@johngoren How we find the culprit was kind of stupid, but necessary because we couldn't find any log give us any useful hints. We cloned the project to a separate directory and started removing modules that we suspected were the culprits one-by-one and run the script below (the same one I posted earlier) until the problem is gone. Besides RN-SVG, try looking for modules that have dev-dependencies of an older version of RN. Good luck!

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

RN 0.46.4 did not 😞

Same still happening on "react-native": "0.47.0-rc.4",, no workaround is working :/

Although 0.46.4 mostly fixed it for me, the error returned this morning but only when I upgraded to the latest version of react-native-firebase.

Any update or workaround ? I have the same problem

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

I downgraded to 0.44.0 and then removed node_modules, also did npm install. After that, it start working.
I did run into unable to resolve ReactPropTypes after downgraded to 0.44.0. But this page solved my issue.

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've spent more time debugging this issue than writing code. Can we get an official response?

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.

I ran into this issue when adding a new package to our package.json:
https://www.npmjs.com/package/react-native-swipe-hidden-header

If I remove this package than the issue goes away. It makes me sad because I wanted to check it out and now I am forced to remove it.

@RyderMS Thats important information but even though if it is a compatibility issue with some 3rd party libraries I think we need at least a better error description to be able to determine which library causes problems.

In my project there are 8 important dependencies in form of RN 3rd party libraries and I cant suddenly remove them all.

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

Confirm that @ywongweb's solution works for me.

I have tried all the solutions except this one, including clear npm cache, reset watchman, etc. But finally I just did a yarn upgrade, and the log shows that some new modules were added comparing to when I was using npm install. And then the issue went away.

I guess yarn may have some differences on finding modules. But I still hope that npm install could work on it. I think before this was resolved, it would be better to point it out in documents.

Hi guys just wanted to share what worked for me. I am using expo. I removed all my node_modules, npm install, reset-cache, restarted expo server, also i updated expo I think i was one version behind (may or may not have been relevant). Good luck all!

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.

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.

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

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

Installing all dependencies one by one seems to be the only thing that works for me.

If I clone my project repo (or delete node_modules) and then let npm or yarn install the dependencies automatically, I always end up with this error.

Have spent lots of hours trying to find a way around this problem, but at least I think I know how to handle it now.

hey guys @kensongoo method worked. Make sure you restart your machine, otherwise the errors will persist.

Restarting the machine or clearing caches does not do anything for me.

Upgrading to RN 47 fixed this for me after a month of failed builds. If you're in the position to, I would recommend upgrading.

Thanks, @HilSny, I'll check

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.)

I started getting this today after this commit but reverting it entirely isn't helping the problem go away (running the whole watchman ... commands). Really weird stuff. Any other thoughts?

Also tried with node 6, 7, and 8, npm 3, 4, and 5. No combo fixes the issue as well.

happens when running jest tests, started happening out of the blue.

image

G:\www\react-native-stager>npm ls --depth=0
[email protected] G:\www\react-native-stager
+-- @types/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- [email protected]
+-- [email protected]
+-- UNMET PEER DEPENDENCY [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

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.

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

can't test neither on Travis-CI nor locally, eventually it will magically resolve itself (how exactly, I'm not sure)

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

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...)

Seems like the issue comes when one of your dependencies has a dependency on an older version of React-Native.

For instance, when I upgraded my project to use RN 0.47, I started to get this error and wasn't able to get rid of it. Found out that my dependency react-native-svg was dependent on RN 0.45, and was also installing that version in my node_modules folder which conflicted. I've updated it, reinstalled, cleaned all cache and re-run the app, and it worked!

So I would think that if you get this error and can't get rid of it, it might be because you have more than 1 version of RN in your node_modules because one of your dependency requires an older version, or because your project still uses an older version and one of your dependency uses a newer version. 0.45 and less don't seem to work well with 0.46 and more...

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

mv origin_project new_project

All these "solutions" are trying to rebuild cache but this will only fix the problem in the case the bug (whenever it is) is already fixed.

I'm not sure if this is a helpful clue, but I can reproduce the error on my RN 0.47.0 setup if I cp the node_modules directory into a second, redundant directory. While bundling, the system then sweeps up duplicates of all my modules and throws "duplicate module name" errors in the building window. And meanwhile we are back to our familiar AccessibilityInfo on the red screen.

What is it about AccessibilityInfo? Was this module only added to RN subsequent to some old, accessibility-unfriendly version of RN that the system is mistakenly falling back on when it finds RN in subfolders?

@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)

For me, using "npm install" did not work, I afterwards got this error that AccessibilityInfo module cannot be found.
Then I just did "yarn" it installed, and the app worked. But I read that for some other people here, the solution is just the opposite. Well, I will enjoy working while I can, I will not update anything as long as I can.

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 !! :)

My solution is same with @zdol, it may be duplicated react-native in _node_modules_ with different version, just temporary solution though.

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

@Elijen Right, yeah, it's definitely there for alphabetical reasons (I think I've also seen a similar bug that mentions DatePickerIOS instead of AccessibilityInfo.) But I wonder, if we could figure out when AccessibilityInfo was added to RN, maybe that could help isolate what's happening if we're going by the theory that some module is loading an obsolete, incompatible version of RN.

i have the same issue overtime i add module by npm. the only time i managed to get pass it is by following the steps and restarting the machine.

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

@johngoren
The AccessibilityInfo module likely has nothing to do with this. It just happens to be the first import in the react-native module.

If you comment out the line where AccessibilityInfo is imported it will fail exactly the same way on the next import.

@teppix Never thought AccessibilityInfo itself was the problem. Rather, thought we could get the ball rolling on identifying the bigger causes of this issue, and start to nail down what specific RN module versions are causing the bug.

We gotta get beyond putting a bandage on it with mere cache clearing! 🍕🍕🍕

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.

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...

I've located the module causing the error, upgraded it to the same react-native file, but still getting the error :/

I found that mismatched devDependencies are making this happen. for example, using [email protected] for [email protected], then react-test-renderer is installing [email protected] and another dependency is installing [email protected] (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@

My Issue 14209 journey.

For me there was an initial error about "buffer" not being available. I ignored this (tut tut), but then the simulator reported the "AccessibiltyInfo" error. I started removing node_modules, and caches, and watchman, but it wouldn't go away. But then (for some reason) I ran a different packager process and the original error was highlighted again. One of the sub packages wasn't installing a needed "buffer" package. I added it in and "voilà".

My suggestions:

Step 1: Ignore "Unable to resolve module AccessibilityInfo" - this is a redherring (as some have reported it is just the first one in a long list of imports in react-native, removing the import just makes the next one have a problem, and the next one, etc...)
Step 2: There's an inconsistency somewhere... (pay particular attention to the react-native packager process).

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)

I previously said that :

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.

I switched to yarn for react-native projects since the 26 July and I no longer encountered this bug, sorry to repost this answer but this may be helpful. I think that this is definitely a npm5 issue.

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.

The issue was yarn in my case. I have lately installed yarn v0.27.5, then _react-native init_ started using yarn instead of npm for installing react and react-native.
Later when I have used npm to install dependencies such as _npm install --save redux_, npm were removing packages such as react & react-native.
I have uninstalled yarn and problem vanished.
Windows 8.1
0.47.2
react-native-cli: 2.0.1
yarn 0.27.5
npm 5.3.0

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

So after playing with this more on latest react-native seems npm --save option is screwing it up.
If you get stuck, remove node_modules and redo with yarn and keep doing with yarn after that using yarn add instead of npm install --save

I don't know if it helps the troubleshooting, but this happened to me twice when trying to follow the install instructions for react-native-pdf. I restored everything after the first try, and the exact same thing happened the second time. Here are the installation steps leading to this mess (NOT saying that the react-native-pdf guys are to blame...just a cause-and-effect):

npm install react-native-pdf --save
react-native link react-native-pdf

npm install react-native-fetch-blob --save
react-native link react-native-fetch-blob

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.

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.

that was my case as well @jnrepo, the renderer was messing everything up

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.

I was able to work-around this by installing the react-native cli instead of using the create-react-native-app tool from the Getting Started page. Since then, everything has built and run without a hitch.

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

if you do the create-react-native-app tool you will always have such issues. Usage of yarn is also recommended i used to have such issues but now its stable here is my RN version
react-native-cli: 2.0.1
react-native: 0.44.1
Try running commands on terminal if you have problems
```rm -fr $TMPDIR/react-*
rm -rf node_modules
yarn install

Restart your PC then continue below

cd android && ./gradlew clean && cd ../ && react-native start -- --reset-cache
react-native run-android
```
this always works for me

npm install [email protected]

@HilSny thanks. Downgrading babel-preset-react-native did it for me.
@pricetula also worked by resetting everything, but I had to install nativebase again and soon after the problem reoccured. Thanks every for your contributions. Cheers!!

yarn add react-native-router-flux@+ Any Version .
This work with me

[resolve]
when I change
"devDependencies": {
"babel-jest": "21.0.2",
"babel-preset-react-native": "4.0.0",
"jest": "21.1.0",
"react-test-renderer": "16.0.0-alpha.12"
},
to
"devDependencies": {
"jest-expo": "~20.0.0",
"react-native-scripts": "1.3.1",
"react-test-renderer": "16.0.0-alpha.12"
},

I've just restarted the JS server, that's it!

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"
  }

I am using:
"react": "16.0.0-alpha.6"
"react-native": "0.44.2"
When i change from npm to yarn, it works like charm. I think maybe it has nothing to to with react or react-native versions

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.

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

I'm using react-native 0.47.2 and I don't have this issue.

@mmarovich sorry about that, I have updated the command

This really work for me:

`npm uninstall babel-preset-react-native

npm install [email protected]`

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

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.

SOLVED:
i had the same issue:
ERROR:
i had following dependencies:
"dependencies": {
"firebase": "^4.4.0",
"react": "16.0.0-alpha.12",
"react-native": "0.48.4",
"react-native-router-flux": "^3.35.0",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},

but the thing is when i install specific verison of [email protected] it gives me the warning at end of installation:
npm WARN [email protected] requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^15.0.2 but none is installed. You must install peer dependencies yourself.

SOLUTION:
-There is 2 things:
1). you can install decencies as we got during installation( npm WARN ..)
2).THIS WHAT I DID TO SOLVED THIS ISSUE:
i). removed react-native-router-flux (npm uninstall react-native-router-flux)
ii). install latest version(pm install react-native-router-flux)
iii). and fews changes in js files.
This thing might be help (NOT RECOMMANDED but still for reference)
*



This above code is working currently
again this () is just for reference ,might be helpful
*
https://github.com/aksonov/react-native-router-flux/issues/1081

dependencies after error resolved:
"dependencies": {
"firebase": "^4.4.0",
"react": "16.0.0-alpha.12",
"react-native": "0.48.4",
"react-native-router-flux": "^4.0.0-beta.21",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},

Here is what I've found so far, hope it could help:
(The steps are in chronological order)

  1. The issue started showing up after I ran "npm --save install react-redux"
  2. Then I removed node_modules and resetting cache, but that DID NOT help.
  3. Then I deleted the whole repo, re-cloned it. Issue persisted.
  4. Then I updated npm to the latest version, the issue disappeared. (react-redux is not a dependency at this point)
  5. Then I ran "npm --save install react-redux" again, the issue came back.
  6. Then I removed react-redux from dependency, the issue disappeared.

It seems like there might be some interaction between npm and some specific modules?

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

yarn cache clean
yarn start

This became an issue for me after I installed the packages "done-bar" and "react-native-keyboard-done-button"

I'm not sure which exactly caused the issues, but when I removed them from my package.json and ran npm install, the issue was instantly fixed.

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.

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 [email protected].

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',
},

I encountered this problem on a very fresh project using react-native 0.49.5 which was the default version that react-native-cli installed, I deleted my node_modules directory, then did npm install and ran into this AccessibilityInfo bug every time I ran it.

There appears to be a peerDependency conflict, npm install is installing something in the wrong order. I was able to recover by upgrading to the latest version of react-native (as of right now v0.50.0-rc.2):

rm -rf node_modules
npm install [email protected] --save
npm install

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.

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

@danstepanov thanks! it works!

The same issue, yarn cache clean && yarn start doesn't work for me
What I got about this issues is that sometimes it can be fixed by running yarn install just after npm install. But it happens randomly and I cannot find any steps to reproduce this and to finally fix the issue.

In our case exploring $TMPDIR and removing haste-map-react-native-packager-* helped!
Removing react-native cache itself or reseting it didn't work.

yarn cache clean && yarn start did it for me! 👍

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.

@SudoPlz

   #ifdef DEBUG
        jsCodeLocation = [NSURL URLWithString:@"http://XXX.XXX.X.XXX:8081/index.ios.bundle?platform=ios&dev=true"];
    #else
        //jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
        jsCodeLocation = [CodePush bundleURL];
    #endif

I have something like this in appdelegate.m, Still does not works. Any thoughts ??

@karna41317 I had the exact same code like you. I couldn't find a proper fix, but I don't care about remote debugging (I mean away from my own work station) so I just changed to jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@“index” fallbackResource:nil];

What do you need [NSURL URLWithString:@"http://XXX.XXX.X.XXX:8081/index.ios.bundle?platform=ios&dev=true"]; for anyway?

I've tried all the methods, but still can't solve. Help!!!!!

"dependencies": {
    "@types/react": "^16.0.25",
    "@types/react-native": "^0.50.7",
    "@types/react-native-fetch-blob": "^0.10.4",
    "@types/react-native-video": "^2.0.0",
    "@types/react-navigation": "^1.0.23",
    "mobx": "^3.3.1",
    "mobx-react": "^4.3.3",
    "react": "16.0.0",
    "react-native": "0.50.4",
    "react-native-android-wifi": "^0.0.19",
    "react-native-audio": "^3.5.0",
    "react-native-camera": "^0.12.0",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-i18n": "^2.0.8",
    "react-native-material-dropdown": "^0.5.2",
    "react-native-md5": "^1.0.0",
    "react-native-qrcode": "^0.2.6",
    "react-native-sound": "^0.10.4",
    "react-native-video": "^2.0.0",
    "react-native-volume": "^0.0.1",
    "react-navigation": "^1.0.0-beta.15"
},
"devDependencies": {
    "@types/jest": "^21.1.7",
    "@types/react-test-renderer": "^16.0.0",
    "babel-jest": "21.2.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-react-native": "4.0.0",
    "jest": "21.2.1",
    "react-test-renderer": "16.0.0-beta.5"
},
"jest": {
    "preset": "react-native"
}

@iamcc You'll have to bite the bullet, and start removing every part of your project, until you find what's causing the problem. That's the only real solution atm. The problem is different for every one.

any news? It's still happening with me on react-native 0.51.0 :/

I'm using expo and I solved it by using the version 21.0.0 of expo : https://blog.expo.io/expo-sdk-21-0-0-is-now-available-be33b79921b7 (following Upgrading Your App section) and npm !

@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

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 [email protected] to do the version changes.

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

For me the solution that worked was:

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

hope this helps

Restart computer worked for me.

It's been 2 weeks I was not facing this issue. BUT NOW, starting from today, it started reproducing all the time and I even cannot start my project in debug mode! I've been doing all the such things as removing all caches (yarn, npm, cocoapods, Xcode, packager, watchman etc), removing node_modules (3 or 4 times), restarting my Mac, restarting my devices. And nothing works! Are you guys having a random thing which prevents React Native from be working? What's the root cause of this issue? Can you close this ticket? I spent tons of hours trying to simply run my project. This is so annoying and the problem it that I don't even see you're going to fix this.

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.

I had just installed the lodash package when I receive Unable to resolve module './_listCacheGet' on build. Based on the many comments here, I reinstalled react-native "react-native": "0.52.0" with yarn (my default installer) with yarn upgrade react-native, then restarted the build. App launched as expected. I think in my case, it appears to have been a caching issue. YMMV. Hope this helps someone.

I had the same issue, figured out the process cache was the problem. Restarting the react native process worked for me

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...

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

npm install react-native --save

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)

Installing over existing node_modules did not help. I ran ncu and upgraded react-native-elements and emptied npm cache, reinstalled etc. Now the problem is gone. Would be good if at least the error had more indication of what the problem is.

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

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

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

Tried all the above methods and still no luck. It started happening to me after I built my binaries in Expo.

I deleted my node_modules folder

npm install
npm start -- --reset-cache

Fixed it for me.

At this point, it happens sporadically for me. Hopefully I can reproduce again soon

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>)

Doing this worked for me:

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

@patrikmolnar's suggestion worked for me.

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

npm install react-native --save

I had a similar problem after switching branches. _Restarting_ my React Native Debugger fixed the issue (even though my app wasn't connected to it).

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...

reclone the project works for me

I get this, and it points to 'Promise' in AccessibilityInfo.ios.js.

If I yarn start it fails.

If I sudo yarn start it reliably works.

This is a really annoying error, and it puts the brakes on every project atm - even new create-react-native-app projects that I then copy my source code into get wrecked.

EDIT: For me it was the react-native-communications package and the warning that I'm not using Expo's fork of react native.

Install node and npm to 7.6.0 and 4.1.2 respectively.

Downgrading helped me.

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.

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

It appears the issue has resurfaced in 0.54

sudo react-native start fixed it for me on 0.54

@foltz @gastonmorixe this issue has already been closed. Can you raise a new issue referencing this one?

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

latest RN uses yarn and at any point if we run npm install...
this mixing causes such issues....
and clearing cache is the solution..
Machine restart is the quickest and simplest solution which works.

npm reinstall worked!

None of the above worked for me. Open your $TMPDIR and delete all metro-* directories.

This npm pull request should fix the issue https://github.com/npm/npm/pull/20198 which is, I believe, due to this npm5 bug https://github.com/npm/npm/issues/16839

THis has costed me days stuck in versions 0.48, 0.49, 0.50 and 0.54. The first time (versions 0.48-0.50) I worked around the problem by using Haul Packager. It wasn't a good solution, and it cost me the ability to run Storybook, but I managed to get by. Now a totally different App, a new version of React Native and the problem is back. And it is completely random. Can't find a way to reproduce it consistently. It gets horribly frustrating seeing the brilliance of the platform being blemished by a silly tooling bug.

React Native 0.54.0
Xcode 9.3

Computer restart helped

npm cache clean --force worked for me

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

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.

to those still struggling: @fr1n63's comment did it for me. i had also tried everything before to no avail. in my case, it was complaining to not find AccessibilityInfo in a context of react-native-vector-icons. as per @fr1n63's suggestion, i deleted the .babelrc in node_modules/react-native-vector-icons, restarted npm --reset-cache and it passed. i could reproduce this; reintroducing the .babelrc and being stuck again. so i'd say if nothing else works, give it a shot - well worth a try.

ps:
"react": "^16.3.2",
"react-native": "^0.54.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"

Clean install with react-native init and run the app on Android device plugged into Macbook. Same error. Unbelievable how long this error has been around, I see posts from 2015. Not sure if it's a RN or NPM thing:

ps:

"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"
  }

"killall -9 node" seems to resolve this issue.

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

Ok, I've just fixed this issue using yarn to manage my dependencies by doing yarn install. I'm not entirely sure of exactly what the issue was, but most likely something involving PATH and globally installed packages.

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.

After delete all folder under 'androidappbuildgenerated' , it works.

After upgrading to npm 6 and using yarn to install the modules, running the packager leads to useful informations:

Loading dependency graph, done.
error: bundling failed: ambiguous resolution: module `/Users/blah/node_modules/react-native/Libraries/react-native/re
act-native-implementation.js` tries to require `AccessibilityInfo`, but there are several files providing this module. You can delete or fix them:

  * `/Users/blah/node_modules/react-native-haptic-feedback/playground/node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js`
  * `/Users/blah/node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js`

As you can see here, I'm using a library that is providing a duplicate file in a playground directory :).

So I assume it is safe to delete it.

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.

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.

Killing the packager and running react-native run-ios again worked for me. Anytime a version number of anything changed this seems to be the solution..

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

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

Still no solution for this issue?

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

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

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"
  }

@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 [email protected]

@sideroff Yes. I also downgraded from v5 to v4.

Is there a solution without downgrading from 0.56.0?

I tried @LasithaPrabodha 's solution. I am stuck at a different error now.

error: bundling failed: Error: While resolving module `merge`, the Haste package `merge` was found. However the module `` could not be found within the package. Indeed, none of these files exist:

  * `D:\ReactNative\ChartSample\node_modules\react-native\Libraries\vendor\core(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
  * `D:\ReactNative\ChartSample\node_modules\react-native\Libraries\vendor\core\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
    at resolveHasteName (D:\ReactNative\ChartSample\node_modules\metro-resolver\src\resolve.js:190:9)
    at Object.resolve (D:\ReactNative\ChartSample\node_modules\metro-resolver\src\resolve.js:68:20)
    at ModuleResolver.resolveDependency (D:\ReactNative\ChartSample\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:161:273)
    at ResolutionRequest.resolveDependency (D:\ReactNative\ChartSample\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:91:16)
    at DependencyGraph.resolveDependency (D:\ReactNative\ChartSample\node_modules\metro\src\node-haste\DependencyGraph.js:272:4579)
    at dependencies.map.relativePath (D:\ReactNative\ChartSample\node_modules\metro\src\DeltaBundler\traverseDependencies.js:376:19)
    at Array.map (<anonymous>)
    at resolveDependencies (D:\ReactNative\ChartSample\node_modules\metro\src\DeltaBundler\traverseDependencies.js:374:16)
    at D:\ReactNative\ChartSample\node_modules\metro\src\DeltaBundler\traverseDependencies.js:212:33
    at Generator.next (<anonymous>)

Hi @ws7one ! Do you tried to delete node_modules folder and reinstall by typing npm install or yarn ?

@lucienbl Yes I did that too.. But I still get the same error

This doesn't seem like a versioning of packages issue. I have projects built exactly on these versions and they still seem to run fine. Not sure what's going wrong. Any help is appreciated because I am quite stuck at this point.

As a recap, this is what all I did:
react-native init projectName
react-native run-android

--gave the "AccessibilityInfo module not found" error--

implemented @LasithaPrabodha 's solution. deleted node_modules and reinstalled using npm install
react-native run-android

--gave the "Error: While resolving module merge..." error--

not sure what else should I try.

If you just downgrade React Native to 0.55.4 and let babel etc.. as is ? @ws7one

@sideroff downgrading react native and babel also worked for me

Will this issue reopen? Or we will stuck at 0.55.4. 🤔

Same as everybody else here. It was broken but everything works again when you downgrade. When I downgraded, I got a notice that said vulnerability issues. Should I be concerned about that?

Same problem here. Running on Windows 10 and react native 0.56.0. Solved when downgraded.

downgrading rn 0.56 to 0.55 worked for me

@lucienbl I tried that..

react-native init projectName
react-native run-android

--gave the "AccessibilityInfo module not found" error--

npm uninstall react-native
npm install --save [email protected]
react-native run-android

this gave me a new error now:

error: bundling failed: Error: Plugin 0 specified in "D:\\ReactNative\\chartSamples\\node_modules\\babel-preset-react-native\\index.js" provided an invalid property of "default" (While processing preset: "D:\\ReactNative\\chartSamples\\node_modules\\babel-preset-react-native\\index.js")
    at Plugin.init (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\plugin.js:131:13)
    at Function.normalisePlugin (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:152:12)
    at D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
    at OptionManager.mergeOptions (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
    at D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14
    at D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22
    at Array.map (<anonymous>)

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

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

This worked for me. :)

This's really bug on version 0.56

@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.

Up to 0.56.1 till 0.55.4 👍

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 [email protected]

npm remove babel-preset-react-native
npm i --save [email protected]

Downgrading to [email protected] worked for me!

I couldn't fix it, with any of these suggestions, reinstalled multiple times and still get the error, I used create-react-app...

It seems that this problem on 56.0 is tracking on #19953.

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 resolved this error?

error: bundling failed: Error: Plugin 0 specified in "D:\\ReactNative\\chartSamples\\node_modules\\babel-preset-react-native\\index.js" provided an invalid property of "default" (While processing preset: "D:\\ReactNative\\chartSamples\\node_modules\\babel-preset-react-native\\index.js") at Plugin.init (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\plugin.js:131:13) at Function.normalisePlugin (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:152:12) at D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30 at Array.map (<anonymous>) at Function.normalisePlugins (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20) at OptionManager.mergeOptions (D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36) at D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14 at D:\ReactNative\chartSamples\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22 at Array.map (<anonymous>)

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 [email protected]
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 [email protected]

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.

@greenais your solution is work for me, thk!

There needs to be a solution for using React Native 56.0. Or is the main problem with Babel?

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

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

@abinax I face the same issue and have to change back to 0.55.4

@tranquan that wasn't enough for me.

first remove your node module folder
then
change react and react-native version 0.56.0 to these.
After trying find the solution so many for latest version of react and react native , i need to downgrade to these versions below, make sure if you are using android, use same dependency version as in package.json

dependencies": {
"react": "16.3.1",
"react-native": "0.55.4"
}

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... 😃

DOES ANY ONE HAVE A PERFECT SOLUTION THEN ONLY ASSIST

I am Getting same error I have setup new windows and then follows the step but its giving me same error everytime

@sarveshcchauhan use my last recommendation:
React native 0.55.4 with Gradle 3.5.1

thank you @greenais !! Downgrading to react-native 0.55.4 and babel-preset-react-native 2.1.0 worked !

I have tried all the options given in this thread, nothing works on my windows.

My package.json is as simple as this

{
  "name": "abc",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "babel-preset-react-native": "^2.1.0",
    "react": "16.4.1",
    "react-native": "^0.55.4"
  },
  "devDependencies": {
    "babel-jest": "23.4.0",
    "jest": "23.4.1",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

@skrajath what's the error are you getting now? is it the same error?

Using WSL could be a workaround.

@abinax
I did one more last try by running in commands 'Run As Adminstrator', strangely there is no error of AccessibilityInfo. The app builds successfully but runs into this error

Unable to load script from assets 'index.android.bundle'

@skrajath that's weird 😶😶

@abinax That's weird, yes. The assets folder was missing android/app/src/main/assets , after creating it, everything works just fine. I finally see the app loaded up clean.

i solved the error as per @ws7one comment.

After that i installed native-base and react-navigation.Simply it shows blank screen.Then changed native-base version to 2.3.5 but react-navigation is not working.

Please someone post the solution

Work @abinax, thanks
@Johncy1997
My package.json

{
  "name": "AppName",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "moment": "^2.22.2",
    "native-base": "^2.7.2",
    "react": "16.4.1",
    "react-apollo": "^2.1.9",
    "react-native": "0.55.4",
    "react-navigation": "^2.8.0"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.6",
    "babel-jest": "23.4.0",
    "babel-preset-react-native": "4.0.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^17.0.0",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.10.0",
    "jest": "23.4.1",
    "prettier-eslint": "^8.8.2",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

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

Just downgrade react-native version to "react-native": "0.55.4"

@Hemant-Synerzip downgrading the react native version only is not a solution 😑. Did you read the replays above??

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" } }

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". :)

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

how have this not been fixed now at react-native 0.56.0 and this issue is very much present

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

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.

@williamdarkocode the language is not incompetent ... maintainers are ... either incompetent or they really do not give a ... maybe they have already moved to native or flutter and do not care anymore :) ... and when it comes to communication ... they really lack any skill

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.

@lahed

I have tried to downgrade react native and installed the matching versions of native-base and react-navigation.It will accept only react-native pure components.Even it does not support react-native-twitter-signin package.It throws next error regarding SDK version.Each and every time it throws different errors..Even i can't delete my project folder.If i try to delete the folder it throws "the source file name(s) are larger than is supported by the file system.."

someone post the accurate solution for all kinds of error.

0.56 seems broken. Use 0.55.4 instead.

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

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.

@PrsRares Maybe they're working in #19953.

@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.

Ok. What worked for me was a little crude but I guess it works so why not.

Instead of doing react-native init, make use create react app, and before installing any dependencies or transferring project directories and files, npm run eject. Don't choose expo eject method. When done ejecting, install all dependencies in your projects package.json, and don't run npm audit fix, no matter the amount of peer dependency errors you see. The reason is when you run npm eject, the core dependencies' versions are to best fit your project. When done with dependencies, simply copy and paste project files, and resolve any errors such as 'Cannot find file/ dir' errors.

"dependencies": {
"react": "^16.4.1",
"react-native": "^0.55.4"
},
"devDependencies": {
"babel-preset-react-native": "^4.0.0",
},
for me even after having following dependencies the error persisted

the below cmds helped me resolve
cd android
gradle clean
cd ..
react-native run-android

Was this page helpful?
0 / 5 - 0 ratings