tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
615 stars 112 forks source link

Do not work on windows #64

Open volodyad opened 6 years ago

volodyad commented 6 years ago

node 8.5 npm 5.6.0 windows 10

for modules like vm, stream - it says Unable to resolve module vm from path to nested node library: Module does not exist in the module map. If I require vm directly from my code - it works, but if require from some child library it says like message above. Seems react-native flag in package.json do not work properly for windows. On mac all works fine.

If I add rn-cli.config like suggested here

module.exports = {
  extraNodeModules: require('node-libs-browser'),
};

https://gist.github.com/parshap/e3063d9bf6058041b34b26b7166fd6bd - it starts working