Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve module buffer #18

Closed
Jancat opened this issue Jan 25, 2018 · 7 comments · May be fixed by #33
Closed

Unable to resolve module buffer #18

Jancat opened this issue Jan 25, 2018 · 7 comments · May be fixed by #33

Comments

@Jancat
Copy link

Jancat commented Jan 25, 2018

My node version is v9.2.1

Does the node doesn't support the deprecated grammer ?

var buffer = require('buffer')
@feross
Copy link
Owner

feross commented Jan 26, 2018

@Jancat Sorry, I don't understand your question. This module is called safe-buffer not buffer.

@feross feross closed this as completed Jan 26, 2018
@Jancat
Copy link
Author

Jancat commented Jan 27, 2018

The safe-buff/index.js line 2

It throws the error:

Unable to resolve module buffer from ./node-modules/safe-buff/index.js: Module does not exist in the module map

@lfernando-silva
Copy link

lfernando-silva commented Jan 27, 2018

Iam having the same error, actually the module buffer is not listed at package.json

@Jancat , do you also getting this error on react-native run-ios/run-android ? maybe it's happening because buffer is a native nodejs module, but may not work at react-native as a lot of native nodejs modules. At commonJS, is not necessary to require buffer.

I think it is my problem too (react-native context)

@Jancat
Copy link
Author

Jancat commented Jan 28, 2018

@lfernando-silva Yes, I'm woking on react-native too. Do you have a good idea to fix the issue or an alternative solution to use sha package in react-native?

@lfernando-silva
Copy link

I think installing buffer by npm install --save buffer and using rn-nodeify to makes adapt Buffer native module, it may to work, but not sure. Maybe you will adapt some other modules of sha package.

In my case, I just replaced bip39 lib to react-native-bip39 and this part is ok now, because does not uses safe-buffer.

@Jancat
Copy link
Author

Jancat commented Jan 28, 2018

Ok, thanks! I will have a try. @lfernando-silva

@feross
Copy link
Owner

feross commented Feb 16, 2018

You might find this issue useful if you're using react-native: facebook/react-native#14796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants