Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

393
Views
A dynamic link library (DLL) initialization routine failed | nw.js error connecting canvas

I use nw.js and when trying to connect the canvas module (node-canvas), this error appears. Installing a different version of node/canvas didn't help. The error appears when require('canvas') Error image: Error

Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\N:\BOTSer\Protocol\node_modules\canvas\build\Release\canvas.node
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1224:18)
    at Module.load (node:internal/modules/cjs/loader:999:32)
    at Function.Module._load (node:internal/modules/cjs/loader:846:12)
    at Module.require (node:internal/modules/cjs/loader:1023:19)
    at require (node:internal/modules/cjs/helpers:97:18)
    at Object.<anonymous> (N:\BOTSer\Protocol\node_modules\canvas\lib\bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1121:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1179:10)
    at Module.load (node:internal/modules/cjs/loader:999:32)
    at Function.Module._load (node:internal/modules/cjs/loader:846:12)
    ```
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

That module requires a native build that is compatible with your global install of Node.js. If the version of Node in NW.js doesn't match your global install, then the built binary will not work with it. Things always work better when you switch your global Node.js install version to match what is built into NW.js. You can use nvm-windows or nvm to control your global Node version, just be sure to uninstall Node.js first before using a Node Version Manager so you don't have two conflicting global installs. You can check the Node.js version in NW.js by running console.log(process.version);.

  • https://github.com/nvm-sh/nvm (OSX/Linux)
  • https://github.com/coreybutler/nvm-windows (Windows 8+)
  • https://github.com/nullivex/nodist (Windows 7)
  • https://nwjs.io/versions.json (All NW.js versions data)

If my assumption is correct then:

  1. Open your app, right-click > inspect > console > process.version > write down the Node version you need > close your app.
  2. Delete node_modules and package-lock.json
  3. Uninstall Node.js globally
  4. Install the correct Node Version Manager for your OS
  5. Use the Node Version Manager to install the version your wrote down in step 1
  6. Do a fresh npm install in your project and try running it again

Though I'm very confused as to why you would be using the native canvas module with NW.js. Why are you packaging an entire browser with your application that has a canvas built in, and then pulling in a second tool and using it instead? Just use the browser's canvas.

  • https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!