How to add local dependencies in react-native project #144185
Unanswered
Rajesh6381
asked this question in
npm
Replies: 3 comments 2 replies
-
Are you using npm install in the correct path? Try to use it in the local path and let me know if it works. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Use npm link with Metro Config: Link the package:
Update metro.config.js in your project to include the package:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm developing React Native packages and I want to add local dependencies to my React Native project. I've tried several methods, but none of them have worked so far.
The only method that worked was packaging the packages using npm pack and then installing the packed packages in my project. However, this approach has the drawback that if I update the code in the local path, the changes are not reflected in the node_modules of the package.
I also tried using npm link, but this resulted in an error in my project indicating that the module could not be found.
Is there a way to resolve this in React Native so that local path changes are reflected in the node_modules of the package?
Beta Was this translation helpful? Give feedback.
All reactions