'Unable to resolve module ./zlib_bindings

We are working on an customised react native app using rocketchat sdk node module. When we are running the app it is giving the below error :

zlib added using

npm i zlib —-save

error: Error: Unable to resolve module ./zlib_bindings from /projectpath/rocketchatsampleclient/node_modules/zlib/lib/zlib.js: None of these files exist: * node_modules/zlib/lib/zlib_bindings(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)

  • node_modules/zlib/lib/zlib_bindings/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)

1 | module.exports = require('./zlib_bindings');



Solution 1:[1]

The problem was that it is a node module built for node applications and not for react native application. So, i replaced it with the node module built for react native application. I replaced the rocket chat sdk package built for react native and that fixed all the problems.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kjpradeep