hgouveia / node-downloader-helper

A simple http file downloader for node.js
MIT License
247 stars 54 forks source link

TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:" with node-downloader-helper #106

Open vamsideepak opened 11 months ago

vamsideepak commented 11 months ago

Getting the below issue when I am trying to download files using node-downloader-helper I am using node 16.16.0 and 18.14.0 by using nvm and also tried by downloading the node manually instead of nvm still no luck. my npm version 8.3.0, node-downloader-helper versions tried 1.0.13 and 2.1.4.

TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new NodeError (node:internal/errors:399:5)
    at new ClientRequest (node:_http_client:189:11)
    at Object.request (node:http:98:10)
    at b.d 

    (C:\Users\XXXX\Desktop\MockServer\Trilogy_Client_Installer\workers\node_modules\node-downloader-helper\dist\index.js:1:6742)
    at b.a (C:\Users\XXXX\Desktop\MockServer\Trilogy_Client_Installer\workers\node_modules\node-downloader-helper\dist\index.js:1:6164)
hgouveia commented 11 months ago

Hello @vamsideepak could you tried the latest version 2.1.8 and let me know?

if the latest version is not fixed, would be possible to you to share the URL that is causing this issue? it seems to me that you are using a http url, but is been redirected to https, if that the case, you could try just use https from the beginning, although every time a redirect is happening, we restart the protocol so it should covers this cases