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
1 Answer
Reset to default 0ECONNREFUSED
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).