Create-react-native-app: Unable to resolve module `AccessibilityInfo`

Created on 3 Aug 2018  路  10Comments  路  Source: expo/create-react-native-app

I thoroughly followed the instructions at https://facebook.github.io/react-native/docs/getting-started , Building Projects with Native Code , Development OS: Windows , Target: Android

After typing react-native run-android in the command prompt. A node command appears and I see this error:

Loading dependency graph, done.
error: bundling failed: Error: Unable to resolve module `AccessibilityInfo` from `C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
    at ModuleResolver.resolveDependency (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:167:1306)
    at ResolutionRequest.resolveDependency (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:80:16)
    at DependencyGraph.resolveDependency (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\node-haste\DependencyGraph.js:237:485)
    at Object.resolve (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\lib\transformHelpers.js:116:25)
    at dependencies.map.result (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:298:29)
    at Array.map (<anonymous>)
    at resolveDependencies (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:294:16)
    at C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:159:33
    at Generator.next (<anonymous>)
    at step (C:\Users\Brad Baguyo\Desktop\AwesomeProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:239:307)
 BUNDLE  [android, dev] ..\..\../index.js 鈻戔枒鈻戔枒鈻戔枒鈻戔枒鈻戔枒鈻戔枒鈻戔枒鈻戔枒 1.2% (2/19), failed.
npm ls react-native-scripts: -- (empty)
npm ls react-native: [email protected]
npm ls expo: -- (empty)
node -v: v10.8.0
npm -v: 6.2.0
yarn --version: 'yarn' is not recognized as an internal or external command, operable program or batch               file.
watchman version: 'watchman' is not recognized as an internal or external command, operable program or batch file.



Operating system: Windows 10
Phone/emulator/simulator & version: Nexus 5x API 23 ,
Resolution: 1080 x 1920: 420dpi, 
API: 23 , Android 6.0 (Google APIs), 
CPU/ABI: x86_64, 
Size on Disk: 3.3GB

The android emulator also says : "The development server returned response error code:500"

Please help me. If you need more information, I will be happy to provide it.

moving-to-expo-cli

Most helpful comment

I have resolved my probles.

Edited package.json

{
  "name": "AwesomeNativeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.4.1",
    "react-native": "0.55.4"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.5.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

All 10 comments

I am still unable to find any solution. Please help

Help

Same issue here. Please help.

I have same issue. Please help

Finally I find the solution!
I'm downgrading react-native from 0.56.0 --> 0.55.4

So open the file of your project named as "package.json"
inside it you can find react-native": "0.56.0" replace this version with react-native": "0.55.4"
and downgrade "babel-preset-react-native" from 5.x to "4.0.0"
--> Save the file.
open CMD (command line), reach to the your project directory and run the command: npm install
continue, run the command: npm i @babel/core
finally, run your project: react-native run-android.

This worked for me. Hope this help you.

I have same issue. Please help,help!

So it looks like so far the only fix to this is what @quangvietntd mentioned. Thanks for the fix! I think this might only be a temporary solution (possible vulnerabilities from downgrading). @quangvietntd did you do trial and error to figure out which versions would work? It seems it is not the same for everybody (aaccording to similar threads).

I have resolved my probles follow @quangvietntd ,Thanks for advice.

Thanks @quangvietntd it solved my issue.

Although I get a warning:
found 2 vulnerabilities (1 low, 1 high) run 'npm audit fix' to fix them, or 'npm audit' for details

The "High" vulnerability is:
High Denial of Service
Package ws
Dependency of react-native
Path react-native > react-devtools-core > ws
More info https://nodesecurity.io/advisories/550

I have resolved my probles.

Edited package.json

{
  "name": "AwesomeNativeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.4.1",
    "react-native": "0.55.4"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.5.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}
Was this page helpful?
0 / 5 - 0 ratings