问题描述
我试图制作一个节点本机插件并且 node-gyp configure build
工作正常,当我需要在 javascript 文件中测试插件并使用 node main
正常运行它然后给出错误 {{1}到目前为止,这是我的代码:
binding.gyp
Error: Module did not self register,code: ERR_DLOPEN_Failed
hello.cc
{
"targets": [
{
"target_name": "hello","source": ["hello.cc"]
}
]
}
main.js
#include <node/node.h>
#include <node/v8.h>
using namespace v8;
void Method(const FunctionCallbackInfo<Value>&args) {
Isolate* isolate = args.GetIsolate();
args.GetReturnValue().Set(String::NewFromUtf8(isolate,"world").ToLocalChecked());
}
void Initialize(Local<Object> exports) {
NODE_SET_METHOD(exports,"hello",Method);
}
NODE_MODULE(NODE_GYP_MODULE_NAME,Initialize);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)