tradle / rn-nodeify

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

Terminal gets frozen during installation process #78

Closed HugoSanchez closed 5 years ago

HugoSanchez commented 5 years ago

Hi,

I'm going through the workflow example:

npm i --save react-native-crypto
# install peer deps
npm i --save react-native-randombytes
react-native link react-native-randombytes
# install latest rn-nodeify
npm i --save-dev mvayngrib/rn-nodeify
# install node core shims and recursively hack package.json files
# in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings
./node_modules/.bin/rn-nodeify --hack --install

however, after running the last command "./node_modules/.bin/rn-nodeify --hack --install", the installation process gets frozen right after starting. It actually froze the terminal and had to close the tab altogether.

I've tried this several times always getting the same result. I've tried it in a Linux Ubuntu computer and on MacOS. I'm using react-native-cli: 2.0.1 and react-native: 0.58.4.

Any reason why that happens?

Thanks!

Here's a screenshot of my terminal:

screenshot 2019-02-13 at 16 47 46
mvayngrib commented 5 years ago

@HugoSanchez the README seems a bit outdated (i've just updated it), can you try installing the latest rn-nodeify from npm and try again? npm i -D rn-nodeify@latest

HugoSanchez commented 5 years ago

It worked!! Thanks so much for getting back

mvayngrib commented 5 years ago

@HugoSanchez glad to hear it :)

HugoSanchez commented 5 years ago

Also, one more question. It is my understanding that, after going through this set up, for every new package that I add to my dependencies, I'll need to make sure to remove .babelrc using rm node_modules/*/.babelrc. So, as long as I do that, I should be able to use any other module right?

Thanks!

mvayngrib commented 5 years ago

@HugoSanchez i haven't had problems recently with dependencies bringing in their own .babelrc, and I haven't been deleting node_modules/*/.babelrc in my own project. Unfortunately, I don't remember the particular case that @vespakoen ran into after which we added that instruction in

"any other module" is pretty broad. There are occasional problems with occasional modules, but for the most part you should be covered :) Modules that rely on native components outside of Node.js core will of course not work, e.g. secp256k1-node will have to fall back to elliptic

HugoSanchez commented 5 years ago

Awesome, yes, I know it's too broad but that was the answer I was looking for. Thanks!