Unable to resolve module `react-native/Libraries/vendor/emitter/EventEmitter`

Updated my project to RN 0.48.1 and React 16.0.0-alpha.12. The project compiles properly and but now getting red screen of death in the iOS Simulator - both from Xcode and with RN CLI - with the following error message:

Bundling index.ios.js [development, non-minified, hmr disabled] 98.5% (766/772), failed.
error: bundling failed: "Unable to resolve module react-native/Libraries/vendor/emitter/EventEmitter from F:\coldbox-android\node_modules\react-native-root-siblings\lib\AppRegistryInjection.js: Module does not exist in the module map

This might be related to facebook/react-native#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 packager cache:  rm -fr $TMPDIR/react-* or  npm start -- --reset-cache."        
     Analysis: F:\coldbox-android\node_modules\react-native-root-siblings\lib\AppRegistryInjection.js: inModule cannot be found, open the file
  4. Finally solved the following original post here . hereby mark
  5. change
    
    import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
    
    to
    
    import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    The above replacement is not absolute, A is changed to B or B is changed to A


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325506390&siteId=291194637