0

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

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

  /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
  
  *長すぎるので省略*
  • ubuntu: VERSION="20.04.6 LTS (Focal Fossa)"
  • Homebrew: 4.1.10
3
  • Ubuntu だと APT を使うのが標準なのですが、そうではなくて Homebrew on Linux を使おうとされているということで正しいですか?
    – nekketsuuu
    Commented 2023年9月8日 12:57
  • そうです。インストールしたいものがhomebrewでのみ提供されてまして。 Commented 2023年9月8日 13:06
  • Homebrew であればビルド手順は大抵オープンになっているかと思うので、自前でビルドしてしまえば良いような気もします。とはいえそれでも Homebrew を使いたいということを想定した回答を書いてみました ja.stackoverflow.com/a/96159/19110
    – nekketsuuu
    Commented 2023年9月8日 13:13

1 件の回答 1

2

/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

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。