Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Protocol "https:" not supported. Expected "http:" #2003

Closed
Aw3same opened this issue Oct 21, 2020 · 7 comments
Closed

[BUG] Protocol "https:" not supported. Expected "http:" #2003

Aw3same opened this issue Oct 21, 2020 · 7 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@Aw3same
Copy link

Aw3same commented Oct 21, 2020

Upgraded from node 14 to node 15.0.0
Upgraded npm to 7.0.3

Current Behavior:

Running the command
npm install -g npm-check-updates
I get the following that doesn't happened in v6.14
image

The error log is:

 TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new NodeError (node:internal/errors:258:15)
    at new ClientRequest (node:_http_client:155:11)
    at request (node:https:313:10)
    at C:\Users\<USER>\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:80:17
    at new Promise (<anonymous>)
    at fetch (C:\Users\<USER>\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:39:10)
    at C:\Users\<USER>\AppData\Roaming\npm\node_modules\npm\node_modules\make-fetch-happen\index.js:297:14
    at C:\Users\<USER>\AppData\Roaming\npm\node_modules\npm\node_modules\promise-retry\index.js:29:24

My npm config doesn't change too:

proxy=http://my.proxycompany.com:80/
http-proxy=http://my.proxycompany.com:80
https-proxy=http://my.proxycompany.com:80/
registry=https://registry.npmjs.org/
strict-ssl=false

EDIT
Changing registry to http it works, but I don't know why.
registry=http://registry.npmjs.org/

Expected Behavior:

Run npm install and install the library successfully.

Environment:

  • OS: Windows 10 v1909
  • Node: 15.0.0
  • npm: 7.0.3
@Aw3same Aw3same added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 21, 2020
@ShenHongFei
Copy link

This PR might help:
TooTallNate/node-agent-base#47
fix ERR_INVALID_PROTOCOL in NodeJS 15 when connect https url through http proxy

@bjansen
Copy link

bjansen commented Nov 2, 2020

Using HTTPS_PROXY as a workaround for #2060 does not work because of this second bug, outstanding.

@maxsxu
Copy link

maxsxu commented Nov 5, 2020

I got the same error in my macOS with the same node/npm version.

I've fixed this error by unset all the proxy environment:

unset http_proxy; unset https_proxy; unset all_proxy;

You can run npm install correctly after that.

@nlf
Copy link
Contributor

nlf commented Nov 6, 2020

updating npm to anything newer than 7.0.6 should correct this as that's when we brought in the updated agent-base dependency

@AbhijeetAnand45
Copy link

change the url to https:// instead of http:// , Mine was type mistake

alexmurray added a commit to alexmurray/vscode-json-languageserver-snap that referenced this issue Oct 29, 2021
LP employs a HTTP proxy so try and make sure this can be used successfully
as the older version of https-proxy-agent has known issues -
e.g. npm/cli#2003
@rafis
Copy link

rafis commented Nov 24, 2021

Downgrading npm from 8.1.4 to 6.14.15 fixes issue.

@IzharUlhaque
Copy link

change the url to https:// instead of http:// , Mine was type mistake

Thank you Bro This work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

9 participants