我使用create-react-native-app在Windows 10上创建了一个React Native项目 . 然后我运行npm run eject来获得标准的React Native应用程序 . 几天,应用程序运行正常,运行npm运行android将在我的设备上显示应用程序correctlu . 但是在安装了几个模块(react-native-app-auth,react-native-navigation)之后,每当我尝试运行应用程序时,这个错误就会在Node控制台中弹出,并且现在每个项目都会不断弹出,甚至新的 .
path\to\project\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: Module `ProgressBarAndroid` 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:\path\to\project\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:161:1460)
at ResolutionRequest.resolveDependency (C:\path\to\project\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:91:16)
at DependencyGraph.resolveDependency (C:\path\to\project\node_modules\metro\src\node-haste\DependencyGraph.js:272:4579)
at dependencies.map.relativePath (C:\path\to\project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:376:19)
at Array.map (<anonymous>)
at resolveDependencies (C:\path\to\project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:374:16)
at C:\path\to\project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:212:33
at Generator.next (<anonymous>)
at step (C:\path\to\project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:297:313)
at C:\path\to\project\node_modules\metro\src\DeltaBundler\traverseDependencies.js:297:473
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
我尝试按照那里的说明,无济于事:https://github.com/facebook/react-native/issues/4968
我也尝试按照那里的说明(我的问题似乎与他们没有关系),但无济于事:React native: Module DrawerLayoutAndroid
does not exist in the Haste module map如果我做了唯一回复中建议的内容,那么同样的错误会出现但是有一个不同的原生模块,如果我继续删除线条,每次都会不断弹出不同的模块 .
我也尝试从头开始,创建一个新项目,使用不同版本的react-native,甚至完全重新安装Node和npm,但错误仍然会弹出 . 我发现让它再次工作的唯一方法是从头开始在另一台机器上 .
提前致谢 .