Friday 9 June 2017

nodejs cannot find native module I build

I want to invoke native c++ code ,than i follow the instruction in https://nodejs.org/dist/latest-v6.x/docs/api/addons.html. but when i ran the .js, it turns out

Error: The specified module could not be found.
\\?\d:\Electron\abandon\src\build\Release\addon.node
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (d:\Electron\abandon\nodejstest.js:6:13)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

But the file it need is in my project,as the picture shows: project image Then i find the error comes from

//module.js
//Native extension for .node
Module._extensions['.node'] = function(module, filename) {
  return process.dlopen(module, path._makeLong(filename));
};

i cheacked the module and filename is right.

so what can i do to fix this?

my OS is Win10 , Nodejs versiong is v6.11.0



via Meeio.Y

No comments:

Post a Comment