NotSpooky / node_dlang

Library to build N-API node modules with the D language
13 stars 1 forks source link

Error: Module did not self-register #1

Open aminya opened 3 years ago

aminya commented 3 years ago

I am trying to load a .node file built with node_dlang, but I get this error.

Here is the issue:

> npm run build.node
❯ node -e "require('./dist/win32-x64/minijson.node')"
node:internal/modules/cjs/loader:1154
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Module did not self-register: '\\?\C:\Users\aminy\Documents\GitHub\D\minijson\dist\win32-x64\minijson.node'.
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1154:18)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at [eval]:1:1
    at Script.runInThisContext (node:vm:129:12)
    at Object.runInThisContext (node:vm:305:38)
    at node:internal/process/execution:81:19
    at [eval]-wrapper:6:22 {
  code: 'ERR_DLOPEN_FAILED'
}

The code is here: https://github.com/aminya/minijson/pull/19

NotSpooky commented 3 years ago

You seem to be using a 32-bit version of NodeJS. If you really need this to work on 32-bit I can try to fix it.

aminya commented 3 years ago

I am using the x64 version:

❯ node -e 'console.log(process.arch)'
x64

The D build was done for x86_64.