React Native: Unable to resolve a local module. Exists in Node Modules

Viewed 238

I'm working on an app that both has a website (React) and mobile app (React Native). In one repository I have my web, mobile and redux files which is my local module/package (so that they can be shared). I have not had any problems with installing my local package when working on web. However with React Native I am running into issues with the package.

I ran

npm install --save '../store/sagas

Which gave me

Unable to resolve "redux-saga-store/sagas/index.js" from "App.js"

Fair. App.js is where I am calling my rootSaga via

import rootSaga from 'redux-saga-store/sagas/index.js';

Which is identical to how web is calling the same file.

I checked my node_modules and the package and all the expected files are there. I tried npm list Which returned (as expected)

redux-saga-store@1.0.0 -> /Users/{myname}/Repos/{repositoryname}/shared/store

I have triple-checked the paths and they are correct.

I tried npm install with the global flag. I went on to nuking my node_modules and package-lock.json so I could try re-installing. I created a brand new react-native app using create-react-native-app which also did not fix the issue. I would really appreciate any suggestions or help

0 Answers
Related