tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
614 stars 114 forks source link

modules broken after single package install #130

Closed nriccar closed 1 year ago

nriccar commented 1 year ago

Hey! First of all, great package, thanks for the contribution.

I wanted to know if there's any workaround to prevent modules breaking after a single package install. Its fine when I run npm i, postinstall gets executed and rn-nodify works. The problem is when a single package is installed, modules stop working. Any way to fix it?

Thanks!

mvayngrib commented 1 year ago

hey @nriccar, i see a relevant issue in the npm repo https://github.com/npm/rfcs/issues/325 . Depending on the version of npm you're using, maybe u can use this? https://stackoverflow.com/a/51155609

nriccar commented 1 year ago

hey @mvayngrib! I have already reviewed those proposals but npm hooks are discontinued.. sadly I have v8.3.1, and I would like to keep using the latest version.. Any other way of keeping rn-nodify changes even if another package gets installed?

Thanks!

mvayngrib commented 1 year ago

sorry, not sure how, other than maybe using your own npm scripts instead of npm i some-package, e.g.

"add": "npm i -S $1 && npm run postinstall"

npm run add some-package

nriccar commented 1 year ago

Thank you.. I have a similar solution, but its not 100% what I was looking for. Now I know, rn-nodify has no way of hacking after a single package install! Thank you for the contribution, its a great package :)