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

Should this be in devDependencies ? #92

Closed Overtorment closed 4 years ago

Overtorment commented 4 years ago

I have a project that works fine, with rn-nodeify sitting in devDependencies. I tried to do npm install --production and got:

> rn-nodeify --install buffer,events,process,stream,util,inherits,fs,path --hack

sh: 1: rn-nodeify: not found

(I have rn-nodeify in my postinstall script)

How is this supposed to work for production builds?

Overtorment commented 4 years ago

oh and the real problem is that ./gradlew assembleRelease fails with

error Unable to resolve module `stream` from `node_modules/cipher-base/index.js`: stream could not be found within the project.
mvayngrib commented 4 years ago

npm install --production is a harder to get working in environments where building is a necessary step before running. If you really want to use npm install --production , why not just move rn-nodeify to dependencies?

oh and the real problem is that ./gradlew assembleRelease fails with

that's because rn-nodeify didn't get to run :)

Overtorment commented 4 years ago

thanks! that's what I thought but decided to ask just for any case.