javascript - Why this error come: Error: connect ECONNREFUSED? - Stack Overflow

I'm trying to connect to the API Mailchimp but I have this error that e when I launch the app.js.

I'm trying to connect to the API Mailchimp but I have this error that e when I launch the app.js.

import mailchimp from "@mailchimp/mailchimp_marketing";

mailchimp.setConfig({
  apiKey: "apiKey",
  server: "server",
});

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

run();

And here is the plete error:

(node:27226) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 0.0.0.0:443
    at TCPConnectWrap.afterConnect [as onplete] (net.js:1144:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:27226) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see .html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:27226) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'm trying to connect to the API Mailchimp but I have this error that e when I launch the app.js.

import mailchimp from "@mailchimp/mailchimp_marketing";

mailchimp.setConfig({
  apiKey: "apiKey",
  server: "server",
});

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

run();

And here is the plete error:

(node:27226) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 0.0.0.0:443
    at TCPConnectWrap.afterConnect [as onplete] (net.js:1144:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:27226) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:27226) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Share Improve this question edited Sep 25, 2023 at 18:54 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Sep 22, 2020 at 13:59 Samy RharadeSamy Rharade 1031 gold badge1 silver badge7 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 0

ECONNREFUSED means that your OS isn't able to setup a TCP connection. There's no service listening on 0.0.0.0:443, which is your own puter. Are you sure that 0.0.0.0 is the host you need to connect to?

Either you need to start the required service on your puter or you need to use the correct IP address (whatever that may be).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745303917a4621600.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信