0

Primeiramente boa tarde, estou começando com react-native agora, e segui um tutorial para configurar meu ambiente de desenvolvimento(windows), ultilizando genymotion, porem sempre que crio um projeto novo, com react-native init (projeto) e executo com react-native run-android ele executa normal porem sempre da esse erro, esse erro aparece antes que eu faça qualquer alteração, alguem poderia me ajudar ? obrigado!

    The development server returned response error code: 500

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

Body:
{"originModulePath":"C:\\Users\\phd\\Desktop\\mobile\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js","targetModuleName":"AccessibilityInfo","message":"Unable to resolve module `AccessibilityInfo` from `C:\\Users\\phd\\Desktop\\mobile\\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\\phd\\Desktop\\mobile\\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\\phd\\Desktop\\mobile\\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\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\node-haste\\DependencyGraph\\ModuleResolution.js:167:1306)\n    at ResolutionRequest.resolveDependency (C:\\Users\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\node-haste\\DependencyGraph\\ResolutionRequest.js:80:16)\n    at DependencyGraph.resolveDependency (C:\\Users\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\node-haste\\DependencyGraph.js:237:485)\n    at Object.resolve (C:\\Users\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\lib\\transformHelpers.js:116:25)\n    at dependencies.map.result (C:\\Users\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:298:29)\n    at Array.map (<anonymous>)\n    at resolveDependencies (C:\\Users\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:294:16)\n    at C:\\Users\\phd\\Desktop\\mobile\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:159:33\n    at Generator.next (<anonymous>)\n    at step (C:\\Users\\phd\\Desktop\\mobile\\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:1162
run
    ThreadPoolExecutor.java:636
run
    Thread.java:764
1
  • Olá, tentou executar os passos ditos no erro? Commented 5/08/2018 às 19:37

1 Resposta 1

4

Primeiro tente realizar os passos do erro:

  • Limpe os watches do watchman: watchman watch-del-all
  • Apague a pasta node_modules: rm -rf node_modules && npm install ou apague normalmente se estiver no Windows;
  • Apague o cache do e incie o servidor: rm -rf /tmp/metro-bundler-cache-* ou npm start -- --reset-cache;

Se nenhum dos citados acime não funcionar, existem algumas versões do react native que não funcionam com windows como a 0.56.0, tente uma outra versão, exemplo:

react-native init myApp --version 0.55.4
2
  • utilizei esse comando e funcionou perfeitamente, obg!
    – phd
    Commented 5/08/2018 às 21:48
  • @phd marca como melhor resposta pra ajudar as pessoas que estarão com o mesmo erro Commented 6/08/2018 às 2:29

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .