Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.9K
Visualizações
ERR_DLOPEN_FAILED When trying to make a node native addon

I was attempting to make a node native addon and node-gyp configure build worked fine, when i required the test addon in a javascript file and ran it normally with node main it then gives the error Error: Module did not self register, code: ERR_DLOPEN_FAILED here is my code so far:

binding.gyp

{
    "targets": [
        {
            "target_name": "hello",
            "source": ["hello.cc"]
        }
    ]
}

hello.cc

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

main.js

const hello = require("./build/Release/hello");
console.log(hello.hello())

How do i fix this error? Thanks.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can check what version of node you are using nvm ls (to list out the node versions)

try changing the node version to check and run the command again nvm use version_number (to change the version)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda