rn-nodeify: Unable to resolve module asyncstorage-down

Hi there,

I’m running React Native and one of the module ws is throwing this error: capture

How can I resolve this?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 28 (12 by maintainers)

Most upvoted comments

asyncstorage-down is in peerDependencies, so needs to be installed manually

npm install asyncstorage-down

yes

react-native link asyncstorage-down (important)

absolutely not! asyncstorage-down is a pure JS module, only modules with ios/android native code need react-native link

@hzburki it’s partially the way dependencies work: asyncstorage-down isn’t automatically installed because it’s a peer dependency of react-native-level-fs, not a direct dependency. Peer dependencies need to be installed explicitly in the top level project, which can be annoying, but on the other hand, it prevents multiple versions of asyncstorage-down from appearing in the dep tree.

…and partially the way the RN packager works:

webpack/browserify/RN packager all have to deal with the same problem: Node.js has core modules (fs, path, process, dgram, net, querystring, crypto, etc.), which don’t exist in other native environments (browser, ios javascript engine, android javascript engine). Webpack and browserify have long relied on a set of “shims” supplied by the community: path-browserify, crypto-browserify, browserify-http, etc., and provided ways to set up module resolution to work. The RN project owners and community have so far cared much less about creating a Node.js-like environment in React Native, and thus you have modules like rn-nodeify trying to bridge the gap.