Unable to resolve module `react-native/Libraries/vendor/emitter/EventEmitter` from `/Users/apple/WebstormProjects/emsrapp/node_modules/react-native-root-toast/node_modules/react-native-root-siblings/lib/AppRegistryInjection.js`: Module does not exist in the module map or in these directories:
/Users/apple/WebstormProjects/emsrapp/node_modules/react-native-root-toast/node_modules/react-native/Libraries/vendor/emitter
, /Users/apple/WebstormProjects/emsrapp/node_modules/react-native/Libraries/vendor/emitter
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 packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
由于版本原因,..react-native-root-toast/node_modules/react-native-root-siblings/lib/AppRegistryInjection.js找到此文件
import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
两种写法互换一下