I have a react-native project and this error appeared when I installed @react-navigation/native package.
ERROR [Error: undefined Unable to resolve module ./types from C:UsersAdminDocumentsProjectsKbOutfitnode_modules@react-navigationcoresrcindex.tsx:
None of these files exist:
- node_modules@react-navigationcoresrctypes(.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
- node_modules@react-navigationcoresrctypesindex(.android.js|.nativeiiive.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
14 | export { default as PreventRemoveContext } from './PreventRemoveContext';
15 | export { default as PreventRemoveProvider } from './PreventRemoveProvider';
> 16 | export * from './types';
| ^
17 | export { default as useFocusEffect } from './useFocusEffect';
18 | export { default as useIsFocused } from './useIsFocused';
19 | export { default as useNavigation } from './useNavigation';]
I tried:-
- Clearing Metro Bundler Cache
npx react-native start --reset-cache
- Installing the latest version of react-navigation package.
npm install @react-navigation/native@latest
But it didn’t solve the problem.