Can't resolve 'react-native/Libraries/vendor/emitter/EventEmitter'

Hi everyone,

I got this error below when I import “react-native-webrtc” in my react project:

ERROR in ./node_modules/react-native-webrtc/lib/module/EventEmitter.js 3:0-78
Module not found: Error: Can’t resolve ‘react-native/Libraries/vendor/emitter/EventEmitter’ in ‘/media/jeff/harddisk/frontend_1128/node_modules/react-native-webrtc/lib/module’

ERROR in ./node_modules/react-native-webrtc/lib/module/RTCView.js 9:15-37
export ‘requireNativeComponent’ (imported as ‘requireNativeComponent’) was not found in ‘react-native’ (possible exports: AccessibilityInfo, ActivityIndicator, Alert, Animated, AppRegistry, AppState, Appearance, BackHandler, Button, CheckBox, Clipboard, DeviceEventEmitter, DeviceInfo, Dimensions, DrawerLayoutAndroid, Easing, FlatList, I18nManager, Image, ImageBackground, InputAccessoryView, InteractionManager, Keyboard, KeyboardAvoidingView, LayoutAnimation, Linking, LogBox, Modal, NativeEventEmitter, NativeModules, PanResponder, PermissionsAndroid, Picker, PixelRatio, Platform, Pressable, ProgressBar, RefreshControl, SafeAreaView, ScrollView, SectionList, Settings, Share, StatusBar, StyleSheet, Switch, Systrace, TVEventHandler, Text, TextInput, ToastAndroid, Touchable, TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, UIManager, Vibration, View, VirtualizedList, YellowBox, findNodeHandle, processColor, render, unmountComponentAtNode, unstable_createElement, useColorScheme, useLocaleContext, useWindowDimensions)

ERROR in ./node_modules/react-native-webrtc/lib/module/ScreenCapturePickerView.js 2:15-37
export ‘requireNativeComponent’ (imported as ‘requireNativeComponent’) was not found in ‘react-native’ (possible exports: AccessibilityInfo, ActivityIndicator, Alert, Animated, AppRegistry, AppState, Appearance, BackHandler, Button, CheckBox, Clipboard, DeviceEventEmitter, DeviceInfo, Dimensions, DrawerLayoutAndroid, Easing, FlatList, I18nManager, Image, ImageBackground, InputAccessoryView, InteractionManager, Keyboard, KeyboardAvoidingView, LayoutAnimation, Linking, LogBox, Modal, NativeEventEmitter, NativeModules, PanResponder, PermissionsAndroid, Picker, PixelRatio, Platform, Pressable, ProgressBar, RefreshControl, SafeAreaView, ScrollView, SectionList, Settings, Share, StatusBar, StyleSheet, Switch, Systrace, TVEventHandler, Text, TextInput, ToastAndroid, Touchable, TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, UIManager, Vibration, View, VirtualizedList, YellowBox, findNodeHandle, processColor, render, unmountComponentAtNode, unstable_createElement, useColorScheme, useLocaleContext, useWindowDimensions)

ERROR in ./node_modules/react-native-webrtc/node_modules/base64-js/index.js
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open ‘/media/jeff/harddisk/frontend_1128/node_modules/react-native-webrtc/node_modules/base64-js/index.js’

ERROR in ./node_modules/react-native-webrtc/node_modules/debug/src/browser.js
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open ‘/media/jeff/harddisk/frontend_1128/node_modules/react-native-webrtc/node_modules/debug/src/browser.js’

ERROR in ./node_modules/react-native-webrtc/node_modules/event-target-shim/index.mjs 74:20-27
Module not found: Error: Can’t resolve ‘process/browser’ in ‘/media/jeff/harddisk/frontend_1128/node_modules/react-native-webrtc/node_modules/event-target-shim’
Did you mean ‘browser.js’?
BREAKING CHANGE: The request ‘process/browser’ failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a ‘.mjs’ file, or a '.js’ file where the package.json contains ‘“type”: “module”’).
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Is there any solution?
Thank you!

Hey There.
Can you provide more info so we can assist better.

What React-Native version are you using?