npmhomebrewngrok

Installing ngrok throws repeated failures with different attempts


I'm having a strange issue with installing ngrok. Per their documentation, I'm running the following command:

brew install ngrok/ngrok/ngrok

I have the latest version of Homebrew. The following error is thrown:

==> Downloading https://bin.equinox.io/a/2AVq3uXxS2b/ngrok-v3-3.14.1-darwin-amd64.zip
curl: (35) LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version

Error: Download failed on Cask 'ngrok' with message: Download failed: https://bin.equinox.io/a/2AVq3uXxS2b/ngrok-v3-3.14.1-darwin-amd64.zip

I've attempted to install it via npm:

npm install ngrok -g

This is throwing a larger error:

npm error code 1
npm error path /Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok
npm error command failed
npm error command sh -c node ./postinstall.js
npm error ngrok - downloading binary https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-darwin-amd64.zip
npm error ngrok - downloading progress:
npm error ngrok - error downloading from URL RequestError: write EPROTO 0096421D01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
npm error
npm error     at ClientRequest.<anonymous> (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/got/dist/source/core/index.js:970:111)
npm error     at Object.onceWrapper (node:events:634:26)
npm error     at ClientRequest.emit (node:events:531:35)
npm error     at origin.emit (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
npm error     at emitErrorEvent (node:_http_client:108:11)
npm error     at TLSSocket.socketErrorListener (node:_http_client:511:5)
npm error     at TLSSocket.emit (node:events:519:28)
npm error     at emitErrorNT (node:internal/streams/destroy:169:8)
npm error     at emitErrorCloseNT (node:internal/streams/destroy:128:3)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm error     at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16) {
npm error   code: 'EPROTO',
npm error   timings: {
npm error     start: 1725891784787,
npm error     socket: 1725891784790,
npm error     lookup: 1725891784792,
npm error     connect: 1725891784841,
npm error     secureConnect: undefined,
npm error     upload: 1725891784847,
npm error     response: undefined,
npm error     end: undefined,
npm error     error: 1725891784849,
npm error     abort: undefined,
npm error     phases: {
npm error       wait: 3,
npm error       dns: 2,
npm error       tcp: 49,
npm error       tls: undefined,
npm error       request: 6,
npm error       firstByte: undefined,
npm error       download: undefined,
npm error       total: 62
npm error     }
npm error   }
npm error }
npm error ngrok - install failed, retrying
npm error ngrok - downloading binary https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-darwin-amd64.zip
npm error ngrok - downloading progress:
npm error ngrok - error downloading from URL RequestError: write EPROTO 0096421D01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
npm error
npm error     at ClientRequest.<anonymous> (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/got/dist/source/core/index.js:970:111)
npm error     at Object.onceWrapper (node:events:634:26)
npm error     at ClientRequest.emit (node:events:531:35)
npm error     at origin.emit (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
npm error     at emitErrorEvent (node:_http_client:108:11)
npm error     at TLSSocket.socketErrorListener (node:_http_client:511:5)
npm error     at TLSSocket.emit (node:events:519:28)
npm error     at emitErrorNT (node:internal/streams/destroy:169:8)
npm error     at emitErrorCloseNT (node:internal/streams/destroy:128:3)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm error     at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16) {
npm error   code: 'EPROTO',
npm error   timings: {
npm error     start: 1725891785358,
npm error     socket: 1725891785359,
npm error     lookup: 1725891785360,
npm error     connect: 1725891785408,
npm error     secureConnect: undefined,
npm error     upload: 1725891785424,
npm error     response: undefined,
npm error     end: undefined,
npm error     error: 1725891785424,
npm error     abort: undefined,
npm error     phases: {
npm error       wait: 1,
npm error       dns: 1,
npm error       tcp: 48,
npm error       tls: undefined,
npm error       request: 16,
npm error       firstByte: undefined,
npm error       download: undefined,
npm error       total: 66
npm error     }
npm error   }
npm error }
npm error ngrok - install failed, retrying
npm error ngrok - downloading binary https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-darwin-amd64.zip
npm error ngrok - downloading progress:
npm error ngrok - error downloading from URL RequestError: write EPROTO 0096421D01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
npm error
npm error     at ClientRequest.<anonymous> (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/got/dist/source/core/index.js:970:111)
npm error     at Object.onceWrapper (node:events:634:26)
npm error     at ClientRequest.emit (node:events:531:35)
npm error     at origin.emit (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
npm error     at emitErrorEvent (node:_http_client:108:11)
npm error     at TLSSocket.socketErrorListener (node:_http_client:511:5)
npm error     at TLSSocket.emit (node:events:519:28)
npm error     at emitErrorNT (node:internal/streams/destroy:169:8)
npm error     at emitErrorCloseNT (node:internal/streams/destroy:128:3)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm error     at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16) {
npm error   code: 'EPROTO',
npm error   timings: {
npm error     start: 1725891785930,
npm error     socket: 1725891785930,
npm error     lookup: 1725891785932,
npm error     connect: 1725891785981,
npm error     secureConnect: undefined,
npm error     upload: 1725891785993,
npm error     response: undefined,
npm error     end: undefined,
npm error     error: 1725891785993,
npm error     abort: undefined,
npm error     phases: {
npm error       wait: 0,
npm error       dns: 2,
npm error       tcp: 49,
npm error       tls: undefined,
npm error       request: 12,
npm error       firstByte: undefined,
npm error       download: undefined,
npm error       total: 63
npm error     }
npm error   }
npm error }
npm error ngrok - install failed RequestError: write EPROTO 0096421D01000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
npm error
npm error     at ClientRequest.<anonymous> (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/got/dist/source/core/index.js:970:111)
npm error     at Object.onceWrapper (node:events:634:26)
npm error     at ClientRequest.emit (node:events:531:35)
npm error     at origin.emit (/Users/mattsmith/.nvm/versions/node/v20.17.0/lib/node_modules/ngrok/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
npm error     at emitErrorEvent (node:_http_client:108:11)
npm error     at TLSSocket.socketErrorListener (node:_http_client:511:5)
npm error     at TLSSocket.emit (node:events:519:28)
npm error     at emitErrorNT (node:internal/streams/destroy:169:8)
npm error     at emitErrorCloseNT (node:internal/streams/destroy:128:3)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm error     at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16) {
npm error   code: 'EPROTO',
npm error   timings: {
npm error     start: 1725891785930,
npm error     socket: 1725891785930,
npm error     lookup: 1725891785932,
npm error     connect: 1725891785981,
npm error     secureConnect: undefined,
npm error     upload: 1725891785993,
npm error     response: undefined,
npm error     end: undefined,
npm error     error: 1725891785993,
npm error     abort: undefined,
npm error     phases: {
npm error       wait: 0,
npm error       dns: 2,
npm error       tcp: 49,
npm error       tls: undefined,
npm error       request: 12,
npm error       firstByte: undefined,
npm error       download: undefined,
npm error       total: 63
npm error     }
npm error   }
npm error }
npm notice

I have no idea why these steps would work.


Solution

  • PM from ngrok here. We recently rolled out a new version of the agent (v3.16.0) and it should be in homebrew (https://github.com/ngrok/homebrew-ngrok/blob/main/Casks/ngrok.rb).

    Double check that your brew is up to date and try to reinstall.