DEV Community

Christopher Maduka
Christopher Maduka

Posted on

Mailchimp NodeJS ENOTFOUND

I'm stuck on this error trying to do health check on my mailchimp api config and i keep getting ENOTFOUND error. I removed my actual api key

The config api call

const mailchimp = require("@mailchimp/mailchimp_marketing");

mailchimp.setConfig({
  apiKey: "API-KEY",
  server: "us-17",
});

async function run() {
  const response = await mailchimp.ping.get();
  console.log(response);
}

run();
Enter fullscreen mode Exit fullscreen mode

Error:

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: getaddrinfo ENOTFOUND us-17.api.mailchimp.com
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'us-17.api.mailchimp.com',
  response: undefined
}
Enter fullscreen mode Exit fullscreen mode

Followed the developer documentation line by line but can't get past this error. Any help/info would be great

Tried

The config api call

const mailchimp = require("@mailchimp/mailchimp_marketing");

mailchimp.setConfig({
  apiKey: "API-KEY",
  server: "us-17",
});

async function run() {
  const response = await mailchimp.ping.get();
  console.log(response);
}

run();
Enter fullscreen mode Exit fullscreen mode

Expected :

{
   "health_status": "Everything's Chimpy!"
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)