96159


Homebrewをwsl on ubuntuにインストールしたんですが、brew installがうまくいかず、brew
doctorをたたくと`Unexpected header files`とやらが大量に出てきました。

これは本当に消していいんですか？  
仮に消すとしてもrm命令を一つ一つ叩くのはきつすぎるんですが…

[code]

      /usr/local/include/node/libplatform/libplatform.h
      /usr/local/include/node/libplatform/v8-tracing.h
      /usr/local/include/node/node.h
      /usr/local/include/node/node_api.h
      /usr/local/include/node/node_api_types.h
      /usr/local/include/node/node_buffer.h
      /usr/local/include/node/node_object_wrap.h
      /usr/local/include/node/node_version.h
      /usr/local/include/node/openssl/aes.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/crypto/bn_conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/crypto/dso_conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/asn1.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/asn1t.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/bio.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/cmp.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/cms.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/configuration.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/crmf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/crypto.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/ct.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/err.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/ess.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/fipskey.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/lhash.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/ocsp.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslv.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/pkcs12.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/pkcs7.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/safestack.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/srp.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/ssl.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/ui.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/x509.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/x509_vfy.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/openssl/x509v3.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/include/progs.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_digests.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_dsa.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_ec.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_ecx.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_rsa.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_sm2.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm/providers/common/include/prov/der_wrap.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/crypto/bn_conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/crypto/dso_conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/asn1.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/asn1t.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/bio.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/cmp.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/cms.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/configuration.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/crmf.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/crypto.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/ct.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/err.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/ess.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/fipskey.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/lhash.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/ocsp.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/pkcs12.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/pkcs7.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/safestack.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/srp.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/ssl.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/ui.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/x509.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/x509_vfy.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/x509v3.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/include/progs.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_digests.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_dsa.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_ec.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_ecx.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_rsa.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_sm2.h
      /usr/local/include/node/openssl/archs/BSD-x86/asm_avx2/providers/common/include/prov/der_wrap.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/crypto/bn_conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/crypto/dso_conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/asn1.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/asn1t.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/bio.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/cmp.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/cms.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/conf.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/configuration.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/crmf.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/crypto.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/ct.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/err.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/ess.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/fipskey.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/lhash.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/ocsp.h
      /usr/local/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslv.h
      
      *長すぎるので省略*
    
[/code]

  * ubuntu: VERSION="20.04.6 LTS (Focal Fossa)"
  * Homebrew: 4.1.10


CC BY-SA 4.0
2023-09-08T12:47:46.997
96158
2023-09-08T13:20:19.880
53242
question
ubuntu bash wsl homebrew
brew doctorで大量のヘッダーファイルを削除するように言われたのだが、本当に削除していいかわからない


`/usr/local/include/node` 下のファイルがあるということは、おそらく Homebrew 以外の手段を使って Node.js
をインストールされたのだと思います。自前でビルドして配置したか、`n` などのバージョン管理ツールが配置したか、そのあたりでしょう。

どうしてこれらのファイルがあるのかを把握しているという前提のもとで、いくつか選択肢は考えられます。

  1. Node.js の管理は Homebrew で行ってしまうとして、それ以外のパッケージマネジャーは消してしまう。その過程で `/usr/local/include/node` も消すことになるはずで、そのあとは Homebrew に任せる。Homebrew on Linux のみで頑張るのは個人的にはちょっと頑張りが必要そうには思いますが……。
  2. 無視する。`brew doctor` で出てくる表示は必ずしも直さないといけない訳ではありません。問題があることだけ認識しておいて、実際に何かしらのパッケージの動作に支障をきたした場合に改めて向き合うことにしても良いでしょう。ただし Homebrew のメンテナーが想定していない不具合は起きるかもしれません。今回は `brew install` のときに問題が起きたとのことなので、その部分については別の質問として投稿いただけると何か考えられることがあるかもしれません（今回のログとほぼ同じログが出て進まなかったということであれば、選択肢 1 ですね……）。

ログが省略されているので `/usr/local/include/node`
以外にもパスが出ているかもしれません。それらも個別に別途で似たような対応ができるでしょう。

参考：英語版での類似 Q&A <https://stackoverflow.com/q/26406484/5989200>


CC BY-SA 4.0
2023-09-08T13:12:42.437
96159
2023-09-08T13:20:19.880
2023-09-08T13:20:19.880
19110
19110
96158
answer