4
votes

I'm trying to develop a new project with React Native. But I have little knowledge of React Native. I did all the setups correctly. But I can not build from emulator. Can you help me? I get an error like this:

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false

Body: {"originModulePath":"C:\Users\cenkd\Desktop\reactprojem\node_modules\react-native\Libraries\react-native\react-native-implementation.js","targetModuleName":"AccessibilityInfo","message":"Unable to resolve module AccessibilityInfo from C:\\Users\\cenkd\\Desktop\\reactprojem\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js: Module AccessibilityInfo does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset 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-*.","errors":[{"description":"Unable to resolve module AccessibilityInfo from C:\\Users\\cenkd\\Desktop\\reactprojem\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js: Module AccessibilityInfo does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset 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-*."}],"name":"Error","stack":"Error: Unable to resolve module AccessibilityInfo from C:\\Users\\cenkd\\Desktop\\reactprojem\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js: Module AccessibilityInfo does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset 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-*.\n at ModuleResolver.resolveDependency (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:167:1306)\n at ResolutionRequest.resolveDependency (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:80:16)\n at DependencyGraph.resolveDependency (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\node-haste\DependencyGraph.js:237:485)\n at Object.resolve (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\lib\transformHelpers.js:116:25)\n at dependencies.map.result (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\DeltaBundler\traverseDependencies.js:298:29)\n at Array.map ()\n at resolveDependencies (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\DeltaBundler\traverseDependencies.js:294:16)\n at C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\DeltaBundler\traverseDependencies.js:159:33\n at Generator.next ()\n at step (C:\Users\cenkd\Desktop\reactprojem\node_modules\metro\src\DeltaBundler\traverseDependencies.js:239:307)"} processBundleResult BundleDownloader.java:285 access$200 BundleDownloader.java:37 onResponse BundleDownloader.java:163 execute RealCall.java:153 run NamedRunnable.java:32 runWorker ThreadPoolExecutor.java:1167 run ThreadPoolExecutor.java:641 run Thread.java:764

Build Error

4

4 Answers

8
votes

i had the same issue.

my previous react-native version was

C:\WINDOWS\system32>react-native -v
react-native-cli: 2.0.1
react-native: 0.56.0

then i uninstall react-native

C:\WINDOWS\system32>npm uninstall -g react-native-cli
removed 41 packages in 3.999s

then i installed react-native version 0.55.4

npm install [email protected]

again intsalled reacnative cli 1.2.0

npm install -g [email protected]

then this installation of creating react-native project work out

react-native init --version="0.55.4" myprojectname
1
votes

This is a bug on version 0.56. so i suggest you to downgrade from 0.56 to version 0.55 just run this command

npm install [email protected] --save
0
votes

I have been searching and trying everything I can do to fix my react project; for me the solution that really worked is downgrade the react version.

My version was 0.59.2; I got an error 500 code message every time I tried to create a project with that version.

So this is my solution :

npm uninstall -g react-native-cli

then you can install the previous version to 0.55.2

npm install [email protected]

and then run :

npm install -g [email protected]

create a new project with previous version :

react-native init --version="0.55.2" yourProjectName
-1
votes

This error also occurs from incorrectly typing file paths. You can also check file paths.