Closed hexxone closed 3 years ago
Hey @thexbasic thanks for the report. What version of RN are you using? Also are you using NPM or YARN?
Same here: react-native info:
Environment: OS: macOS Sierra 10.12.6 Node: 6.11.1 Yarn: 1.1.0 npm: 3.10.10 Watchman: 4.7.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.49.1 => 0.49.1
Same here!
Yarn 1.1.0 React 16.0.0-beta.5 React-native 0.49.1
Yarn 1.1.0 React 16.0.0-beta.5 React-native 0.49.1
same issue
I had same problem and npm i buffer solved my issue. https://github.com/bartonhammond/snowflake/issues/98
Will this ever be fixed ?
So I just had this issue and have been looking into it - it looks like this module breaks because it requires the "randombytes" module, which requires "safe-buffer", which in turn requires "buffer". "Buffer" is a Node standard library api, meaning that it ships by default with an installation of Node. Problem is, Node standard library modules are largely written in C++ like the rest of Node, and are not written in Javascript like most NPM modules. Since React Native has no capability for running C++ code, "buffer" doesn't work, and hence neither does this package.
As far as I can tell, @eugenehp can fix this issue by removing randombytes from the implementation, swapping it out with a module that performs the same function but is written specifically for React Native. I haven't checked, but this one might work:
error: bundling failed: "Unable to resolve module
buffer
fromD:\\ProjectABC\\node_modules\\safe-buffer\\index.js
: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches:watchman watch-del-all
.\n 2. Delete thenode_modules
folder:rm -rf node_modules && npm install
.\n 3. Reset packager cache:rm -fr $TMPDIR/react-*
ornpm start -- --reset-cache
."Used it like the example using require, and even tried import - same result. Also installing the module 'buffer' seperately doesnt help anything. I guess it's deprecated?