Brew doctor - “warning: unbrewed header files were found in /usr/local/include”?

后端 未结 4 1065
南笙
南笙 2020-12-07 18:16

When I run brew doctor, the following error is thrown

Warning: Unbrewed header files were found in /usr/local/include.
If you didn\'t put them t         


        
相关标签:
4条回答
  • 2020-12-07 18:46

    It looks like you installed curl and nodejs without using homebrew.

    You have two options:

    1. Do nothing except remember this forever, so that you don't think they are from homebrew and wonder why homebrew is complaining.
    2. Remove them and install nodejs and curl from homebrew.

    1 is the easy way, until it isn't.

    I recommend #2 because it is likely, in the future you will install something from homebrew which depends on curl and/or node and homebrew will attempt to install those dependencies. When building from source, wrong headers may get used and mismatch libraries being linked. This is not fun to debug.

    If those non homebrew header files are there for a reason and you are compiling software with them, then you are probably able to put them back if you need them. If you aren't building software with them, then you don't need them. Go ahead and delete them for now.

    0 讨论(0)
  • 2020-12-07 18:50

    You can skip the stray header checks to make it easier to see if there are issues other than node/npm not playing nicely with homebrew

    brew doctor `brew doctor --list-checks | grep -v stray_headers`
    
    0 讨论(0)
  • 2020-12-07 18:53

    This solution worked for me!

    sbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do  sudo rm /usr/local/${f}; done
    
    sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
    
    0 讨论(0)
  • 2020-12-07 18:55

    It may be safe to leave those files in place unless you encounter build or link problems with other Homebrew formulas; brew doctor output is advisory, not normative.

    If you don't think you have a reason to build against the versions of curl or node in /usr/local, you can remove those header files; you can always reinstall the newest version later with Homebrew.

    0 讨论(0)
提交回复
热议问题