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

STRELOK

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)
    ```
Jaredcheeda

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);.

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Javascript

Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

From Dev

FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

From Dev

C#: A dynamic link library (DLL) initialization routine failed

From Dev

Error while importing Tensorflow. A dynamic link library (DLL) initialization routine failed

From Dev

Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

From Dev

Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

From

Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

From Dev

How to fix Java 15 JNI "UnsatisfiedLinkError: A dynamic link library (DLL) initialization routine failed"

From Dev

Trying to use win32ui with pywin32 gives: A dynamic link library (DLL) initialization routine failed

From Python

Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

From Dev

Build tesseract as DLL Dynamic link library

From Dev

Server library could not be loaded and the dynamic link library LIBPQ.dll

From Dev

Could not be located in dynamic link library php4ts.dll

From Dev

The ordinal 3283 could not be located in the dynamic link library libmysql.dll

From Dev

Compaq Visual Fortran 6.6, Dynamic-Link Library (DLL) and Module

From Dev

Failed to link with standard library

From Dev

Dynamic link library in C

From Dev

Msys2 GDB error "The procedure entry point dllMain could not be located in the dynamic link library C:\msys64\mingw64\bin\libncursesw6.dll"

From Dev

VSTOInstaller.exe error 0x8007007F The procedure entry point GetFileVersionInfoExW could not be located in the dynamic link library VERSION.dll

From Dev

Is it possible for multiple Dynamic Link Libraries (DLL) to share Thread Local Storage from a Static Library (LIB)

From Dev

The procedure entry point ... renderSynchronous@QRenderAspectPrivate@Qt3DRender ... could not be located in the dynamic link library ... *.dll

From Java

Architecturally what is the difference between a shared object (SO) and a dynamic link library (DLL)?

From Dev

The procedure entiy point_JVM_GetClassMethod@24 could not belocated in the dynamic link library jvm.dll

From Dev

Canvas drawing library for js

From Dev

Pystan, Runtime error - Initialization failed

From Dev

Dynamic route in react link to is not connecting with route

From Dev

Unable to link dynamic library in macOS

From Dev

Pass function to dynamic link library

From Dev

Link to a dynamic link library in a cmake project

Related Related

  1. 1

    Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

  2. 2

    FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

  3. 3

    C#: A dynamic link library (DLL) initialization routine failed

  4. 4

    Error while importing Tensorflow. A dynamic link library (DLL) initialization routine failed

  5. 5

    Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

  6. 6

    Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

  7. 7

    Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

  8. 8

    How to fix Java 15 JNI "UnsatisfiedLinkError: A dynamic link library (DLL) initialization routine failed"

  9. 9

    Trying to use win32ui with pywin32 gives: A dynamic link library (DLL) initialization routine failed

  10. 10

    Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

  11. 11

    Build tesseract as DLL Dynamic link library

  12. 12

    Server library could not be loaded and the dynamic link library LIBPQ.dll

  13. 13

    Could not be located in dynamic link library php4ts.dll

  14. 14

    The ordinal 3283 could not be located in the dynamic link library libmysql.dll

  15. 15

    Compaq Visual Fortran 6.6, Dynamic-Link Library (DLL) and Module

  16. 16

    Failed to link with standard library

  17. 17

    Dynamic link library in C

  18. 18

    Msys2 GDB error "The procedure entry point dllMain could not be located in the dynamic link library C:\msys64\mingw64\bin\libncursesw6.dll"

  19. 19

    VSTOInstaller.exe error 0x8007007F The procedure entry point GetFileVersionInfoExW could not be located in the dynamic link library VERSION.dll

  20. 20

    Is it possible for multiple Dynamic Link Libraries (DLL) to share Thread Local Storage from a Static Library (LIB)

  21. 21

    The procedure entry point ... renderSynchronous@QRenderAspectPrivate@Qt3DRender ... could not be located in the dynamic link library ... *.dll

  22. 22

    Architecturally what is the difference between a shared object (SO) and a dynamic link library (DLL)?

  23. 23

    The procedure entiy point_JVM_GetClassMethod@24 could not belocated in the dynamic link library jvm.dll

  24. 24

    Canvas drawing library for js

  25. 25

    Pystan, Runtime error - Initialization failed

  26. 26

    Dynamic route in react link to is not connecting with route

  27. 27

    Unable to link dynamic library in macOS

  28. 28

    Pass function to dynamic link library

  29. 29

    Link to a dynamic link library in a cmake project

HotTag

Archive