Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

INVALID PROTOCOL: When we try to install #591

Open
@Alexis01

Description

@Alexis01

Hi 👋 , Serverless Framework core team here!

We have a yeoman generator and when why try to execute the following command we got an error

npm i serverless-express serverless-azure-functions

The stacktrace is

npm ERR! path /mnt/c/tmp/serverless-azure/node_modules/azure-functions-core-tools
npm ERR! command failed
npm ERR! command sh -c node lib/install.js
npm ERR! attempting to GET "https://functionscdn.azureedge.net/public/3.0.3904/Azure.Functions.Cli.linux-x64.3.0.3904.zip"
npm ERR! using proxy server "http://xxx.xxx.xxx.xxx:xx/"
npm ERR! node:_http_client:158
npm ERR!     throw new ERR_INVALID_PROTOCOL(protocol, expectedProtocol);
npm ERR!     ^
npm ERR!
npm ERR! TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
npm ERR!     at new NodeError (node:internal/errors:371:5)
npm ERR!     at new ClientRequest (node:_http_client:158:11)
npm ERR!     at request (node:https:353:10)
npm ERR!     at Object.get (node:https:387:15)
npm ERR!     at Object.<anonymous> (/mnt/c/tmp/serverless-azure/node_modules/azure-functions-core-tools/lib/install.js:63:7)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1103:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
npm ERR!     at node:internal/main/run_main_module:17:47 {
npm ERR!   code: 'ERR_INVALID_PROTOCOL'
npm ERR! }

As you can saw my proxy have HTTP PROTOCOL
I had to change my proxy protocol because with HTTPS doesn't work either

npm ERR! code 1
npm ERR! path C:\tmp\serverless-azure\node_modules\azure-functions-core-tools
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node lib/install.js
npm ERR! attempting to GET "https://functionscdn.azureedge.net/public/3.0.3904/Azure.Functions.Cli.win-x64.3.0.3904.zip"
npm ERR! using proxy server "https://xxx.xxxx.xxx:xx"
npm ERR! node:_http_client:158
npm ERR!     throw new ERR_INVALID_PROTOCOL(protocol, expectedProtocol);
npm ERR!     ^
npm ERR!
npm ERR! TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
npm ERR!     at new NodeError (node:internal/errors:371:5)
npm ERR!     at new ClientRequest (node:_http_client:158:11)
npm ERR!     at request (node:https:353:10)
npm ERR!     at Object.get (node:https:387:15)
npm ERR!     at Object.<anonymous> (C:\tmp\serverless-azure\node_modules\azure-functions-core-tools\lib\install.js:63:7)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:17:47 {
npm ERR!   code: 'ERR_INVALID_PROTOCOL'
npm ERR! }

I' m behind a proxy but it works normally with all npm packages

Additional Data

  • Operating System:
    Windows 10
  • Node Version:
    v16.14.0

Any feedback is appreciated!

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions