LoginSignup
0
1

More than 1 year has passed since last update.

ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MACの対処メモ(Windows10、node v16.17.0)

Posted at

Vuepressのプロジェクトをリポジトリから取得し、npm installしたときに標題のエラーが出たので、その対処をメモしておきます。
以下は実際のエラーです。

$ npm install
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! 5228:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
:
npm ERR! A complete log of this run can be found in:
npm ERR!     【..local npm log dir..】\2022-09-29T02_57_10_549Z-debug-0.log

エラーが出た環境は以下になります。

名称 バージョン 備考
OS Windows 10 64bit Home
Node.js v16.17.0 nvmでインストール
package Dependencies vuepress^1.5.3
http-server^14.1.1

先に結論

Windows Defender ファイアウォールでNode.js JavaScript Runtimeのファイアウォール経由通信を許可したら通りました。

解決までの手順

  1. ログの確認
    エラーログに書いてあったログファイルを見てみます。
    SSLの問題っぽいということはわかりましたが、コンソールに出力された情報とたいして変わりませんでした。

    :
    225 verbose stack Error: 3956:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
    225 verbose stack
    226 verbose cwd 【..node project dir..】
    227 verbose Windows_NT 10.0.19044
    228 verbose node v16.17.0
    229 verbose npm  v8.15.0
    230 error code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
    231 error 3956:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
    231 error
    232 verbose exit 1
    :
    
  2. エラーコードで検索
    Githubの解決済みのissueページが出てきたので参照します。
    npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC #3815
    Windows defender firewallの設定を変えたら解決したというコメントがちらほら。
    どのパッケージか分かりませんが、インストール時にSSLハンドシェイクをするのであればNodeクライアントが外部通信をするので、邪魔されている可能性はありそうです。

  3. Windows Defender ファイアウォールの設定を変更
    Node.js JavaScript Runtimeからの通信を許可しました。

    1. 「Windows Defender ファイアウォール」の設定を開く
    2. 「Windows Defender ファイアウォールを介したアプリまたは機能を許可」
    3. 「設定の変更」で変更開始
    4. 「別のアプリの許可」で新たに設定
    5. node.exeを選んで「追加」
  4. 再度npm installの実行
    同じエラーがでました。ファイアウォールの設定が反映されていない可能性があるため、PCを再起動。

  5. 再々度npm installの実行
    できました。

まとめ

大した内容じゃないですが、まだ同じエラーに対して日本語での対処記事がなかったので、書きました。
同じ問題にあたった誰かの助けになればと思います。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1