当我运行brew doctor
时,会抛出以下错误
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/curl/curl.h
/usr/local/include/curl/curlbuild.h
/usr/local/include/curl/curlrules.h
/usr/local/include/curl/curlver.h
/usr/local/include/curl/easy.h
/usr/local/include/curl/mprintf.h
/usr/local/include/curl/multi.h
/usr/local/include/curl/stdcheaders.h
/usr/local/include/curl/typecheck-gcc.h
/usr/local/include/node/ares.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/nameser.h
/usr/local/include/node/node.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node_internals.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_version.h
/usr/local/include/node/openssl/opensslconf.h
/usr/local/include/node/uv-private/ngx-queue.h
/usr/local/include/node/uv-private/stdint-msvc2008.h
/usr/local/include/node/uv-private/tree.h
/usr/local/include/node/uv-private/uv-bsd.h
/usr/local/include/node/uv-private/uv-darwin.h
/usr/local/include/node/uv-private/uv-linux.h
/usr/local/include/node/uv-private/uv-sunos.h
/usr/local/include/node/uv-private/uv-unix.h
/usr/local/include/node/uv-private/uv-win.h
/usr/local/include/node/uv.h
/usr/local/include/node/v8-debug.h
/usr/local/include/node/v8-preparser.h
/usr/local/include/node/v8-profiler.h
/usr/local/include/node/v8-testing.h
/usr/local/include/node/v8.h
/usr/local/include/node/v8stdint.h
/usr/local/include/node/zconf.h
/usr/local/include/node/zlib.h
删除这些文件会安全吗?解决此警告的最佳方法是什么?
答案 0 :(得分:67)
看起来你没有使用自制软件就安装了curl和nodejs。
您有两种选择:
我建议#2,因为将来你可能会安装自制软件和/或节点的东西,而自制软件将尝试安装这些依赖项。从源代码构建时,可能会使用错误的标头并链接不匹配的库。这对调试来说并不好玩。
如果那些非自制文件头文件出于某种原因并且您正在使用它们编译软件,那么您可能会在需要时将它们放回原处。如果您不与他们一起构建软件,那么您就不需要它们。继续,暂时删除它们。
答案 1 :(得分:4)
您可以跳过杂散标题检查,以便更容易查看node / npm之外是否存在与homebrew无法正常播放的问题
$res = array();
while ($resultSet = mysqli_fetch_assoc($result)) {
foreach($resultSet as $key => $value) {
$res[$key] = $value;
}
}
答案 2 :(得分:2)
将这些文件保留在原位可能是安全的,除非您遇到与其他Homebrew公式的构建或链接问题; brew doctor
输出是建议性的,而不是规范性的。
如果您认为没有理由在/ usr / local中构建curl或node的版本,则可以删除这些头文件;您可以随后使用Homebrew重新安装最新版本。
答案 3 :(得分:0)
我会将它们复制到一个文件 (tmpKill
) 中,然后运行:
xargs -0 -n 1 rm -rf < <(tr \\n \\0 <tmpKill)
这样可以很容易地将他们全部杀死。最左边的命令生成一组运行 rm -rf
命令的行。 -n
指令确保命令 (rm -rf
) 每个条目仅运行一次。
答案 4 :(得分:-10)
This solution为我工作了!
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.*