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

Issue using rn-nodeify in React-native project #100

Closed MohamedAhmed122 closed 3 years ago

MohamedAhmed122 commented 3 years ago

I am developing a mobile app using React native, which involves an interaction with Meta1.js and web3.js

RN does not support core Node.js modules, so I had to install react-native-crypto, react-native-randombytes, rn-nodeify and run ./node_modules/.bin/rn-nodeify --hack --install I actually followed the docs

and now I am facing this error

Screenshot 2021-04-02 at 18 08 01

I also tried to install node, clean the cache, delete watchman, and none of that worked for me, and when I run yarn ios the app crash (build failed)

package.json

"``` scripts": { "android": "react-native run-android", "postinstall": "rn-nodeify --install fs,dgram,process,path,console --hack", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/masked-view": "^0.1.10", "@react-navigation/bottom-tabs": "^5.11.8", "@react-navigation/native": "^5.9.3", "@react-navigation/stack": "^5.14.3", "@tradle/react-native-http": "^2.0.1", "assert": "^1.5.0", "browserify-zlib": "^0.1.4", "buffer": "^4.9.2", "console-browserify": "^1.2.0", "constants-browserify": "^1.0.0", "dns.js": "^1.0.1", "domain-browser": "^1.2.0", "https-browserify": "0.0.1", "path-browserify": "0.0.0", "process": "^0.11.10", "punycode": "^1.4.1", "querystring-es3": "^0.2.1", "react": "17.0.1", "react-native": "0.64.0", "react-native-crypto": "^2.2.0", "react-native-gesture-handler": "^1.10.3", "react-native-level-fs": "^3.0.1", "react-native-modal": "^11.7.0", "react-native-os": "^1.2.6", "react-native-randombytes": "^3.6.0", "react-native-reanimated": "^2.0.0", "react-native-safe-area-context": "^3.2.0", "react-native-screens": "^2.18.1", "react-native-tcp": "^3.3.2", "react-native-udp": "^2.7.0", "react-native-vector-icons": "^8.1.0", "readable-stream": "^1.0.33", "rn-nodeify": "^10.2.0", "stream-browserify": "^1.0.0", "string_decoder": "^0.10.31", "timers-browserify": "^1.4.2", "tty-browserify": "0.0.0", "url": "^0.10.3", "vm-browserify": "0.0.4" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.64.0", "react-test-renderer": "17.0.1" }, "jest": { "preset": "react-native" }, "react-native": { "console": "console-browserify", "path": "path-browserify", "fs": "react-native-level-fs", "dgram": "react-native-udp", "zlib": "browserify-zlib", "constants": "constants-browserify", "crypto": "react-native-crypto", "dns": "dns.js", "net": "react-native-tcp", "domain": "domain-browser", "http": "@tradle/react-native-http", "https": "https-browserify", "os": "react-native-os", "querystring": "querystring-es3", "_stream_transform": "readable-stream/transform", "_stream_readable": "readable-stream/readable", "_stream_writable": "readable-stream/writable", "_stream_duplex": "readable-stream/duplex", "_stream_passthrough": "readable-stream/passthrough", "stream": "stream-browserify", "timers": "timers-browserify", "tty": "tty-browserify", "vm": "vm-browserify", "tls": false }, "browser": { "console": "console-browserify", "path": "path-browserify", "fs": "react-native-level-fs", "dgram": "react-native-udp", "zlib": "browserify-zlib", "constants": "constants-browserify", "crypto": "react-native-crypto", "dns": "dns.js", "net": "react-native-tcp", "domain": "domain-browser", "http": "@tradle/react-native-http", "https": "https-browserify", "os": "react-native-os", "querystring": "querystring-es3", "_stream_transform": "readable-stream/transform", "_stream_readable": "readable-stream/readable", "_stream_writable": "readable-stream/writable", "_stream_duplex": "readable-stream/duplex", "_stream_passthrough": "readable-stream/passthrough", "stream": "stream-browserify", "timers": "timers-browserify", "tty": "tty-browserify", "vm": "vm-browserify", "tls": false } }



@mvayngrib 
do you know what is the problem?