我在安装 ngrok 时遇到了一个奇怪的问题。根据他们的文档,我正在运行以下命令:
brew install ngrok/ngrok/ngrok
我有最新版本的 Homebrew。抛出以下错误:
==> 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
我尝试通过 npm 安装它:
npm install ngrok -g
这会引发更大的错误:
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
我不知道为什么这些步骤会起作用。
来自ngrok的PM在这里。我们最近推出了新版本的代理 (v3.16.0),它应该是自制程序 (https://github.com/ngrok/homebrew-ngrok/blob/main/Casks/ngrok.rb)。
仔细检查您的brew是否是最新的并尝试重新安装。