node-ytdl-core
node-ytdl-core copied to clipboard
(node:557) UnhandledPromiseRejectionWarning: Error: unable to get local issuer certificate
I just installed with npm install ytdl-core@latest, created an index.js that contains the "Usage" example in the readme, and ran
% node index.js
(node:557) UnhandledPromiseRejectionWarning: Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)
at TLSSocket.emit (events.js:400:28)
at TLSSocket._finishInit (_tls_wrap.js:937:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:557) 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.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:557) [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.
looks like a problem with your local certificate chain other tools like youtubedl and maybe even chrome should have similar problems sorry but we can't help you with that
Same problem here, and I'm able to use other tools like youtube-dl, chrome , curl, or even a fetch inside NodeJS.
@RobKohr, in my case, I solved the problem by disabling the NODE_TLS_REJECT_UNAUTHORIZED, for example: NODE_TLS_REJECT_UNAUTHORIZED=0 yarn run start.
My env:
Apple M1 Pro with Sonoma 14.3.1Node v18.18.2- Credits StackOverflow