question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module './zlib_bindings'

See original GitHub issue

node v0.6.1 pdfkit v0.1.6

Code:

var pdf = require('pdfkit');

Error log:

Error: Cannot find module './zlib_bindings'
    at Function._resolveFilename (module.js:334:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous> (/home/user/share/test_pdfkit/node_modules/pdfkit/node_modules/flate/lib/zlib.js:1:80)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Module.require (module.js:357:17)

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:26 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
Jamal8548commented, Mar 16, 2022

@jacksctsai Please help me i did not get your this solution please explain it Goto node_modules/pdfkit/node_modules/flate/ directory. Copy the file zlib_bindings from build/Release directory to lib directory.

I could not find any folders in node_modules. I installed pdfkit from npm and please tell me now what i have to do? where is the flate? and all the other zlib+bindings? I am using react. Please elaborate your solution here

0reactions
vikasacharya16commented, Nov 2, 2021

To improve the likehood of getting support, more info should de provided:

What environment ? Node? browser? What bundler? Webpack? Rollup? Provide a minimal reproduction snippet

I got the error and mentioned how to reproduce here, Kindly have a look. https://stackoverflow.com/questions/69805191/what-is-the-proper-way-to-use-pdfkit-in-react-native

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught Error: Cannot find module 'zlib' - Stack Overflow
have you add the zib module, in the package.json using npm install zlib , after that when you do npm install, i guess...
Read more >
Issues - GitHub
hi guys I have an error with my app it says Error: Cannot find module './zlib_bindings' my webpack config.
Read more >
help - Meteor forums
I have an NPM dependency on 'zlib': '1.0.5'. When I add this dependency I get this ... Uncaught Error: Cannot find module './zlib_bindings'....
Read more >
zlib - npm
BUILDING. Make sure you have zlib installed. Mac OS X ships with it by default. To obtain and build the bindings:
Read more >
Module not found: Can't resolve 'zlib' error [Solved] | bobbyhadz
The error "Module not found: Can't resolve 'zlib'" most commonly occurs when you import a Node.js specific function in your frontend (e.g. React.js) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found