pulsar-client-node icon indicating copy to clipboard operation
pulsar-client-node copied to clipboard

Installed pulsar-client-node successfully but when require the module throw "Error: The specified module could not be found."

Open HyperClockUp opened this issue 3 years ago • 1 comments

  1. install C++ version as doc
  2. build Release and set system variable as README
  3. install pulsar-client successfully
  4. require("pulsar-client")
  • node:18.4.0
  • system:Win 10

the minium error code is following:

const Pulsar = require('pulsar-client');

console.log(Pulsar);

but the terminal throw an error like

[Running] node "e:\pulsar-client-node\test.js"
e:\pulsar-client-node\node_modules\bindings\bindings.js:121
        throw e;
        ^

Error: The specified module could not be found.

\\?\e:\pulsar-client-node\node_modules\pulsar-client\build\Release\Pulsar.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1196:18)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at bindings (e:\pulsar-client-node\node_modules\bindings\bindings.js:112:48)
    at Object.<anonymous> (e:\pulsar-client-node\node_modules\pulsar-client\index.js:20:42)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32) {
  code: 'ERR_DLOPEN_FAILED'
}

I've searched for a while, and some answers say that maybe the vcpkg lead this error, but I don't know how to solve it. If someone can help me, i'll be reallllly grateful.

HyperClockUp avatar Jul 04 '22 16:07 HyperClockUp

hey @HyperClockUp, any news on this? I'm stuck in the same error too. But in my case the error says: TypeError: Cannot read properties of undefined (reading 'modules') at Object.eval (bindings.js?2902:29:1) at eval (bindings.js:223:30) at ./node_modules/pulsar-client/node_modules/bindings/bindings.js (chunk-vendors.js:18167:1) at webpack_require (app.js:854:30) at fn (app.js:151:20) at eval (index.js?11ce:20:1) at ./node_modules/pulsar-client/index.js (chunk-vendors.js:18156:1) at webpack_require (app.js:854:30) at fn (app.js:151:20) at VueComponent.mounted (Layout1.vue?8b50:222:1)

HenriqueSerafim avatar Jul 08 '22 09:07 HenriqueSerafim