请帮助了解正在发生的事情——或者是否需要采取任何行动。我已经阅读了很多关于处理 brew、node、symlink、卸载和重新安装的 node、npm、yarn、tryed 的帖子brew cleanup。当brew doctor产生这些警告时——
Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/lib/node_modules/npm/node_modules/.bin/JSONStream
/usr/local/lib/node_modules/npm/node_modules/.bin/errno
/usr/local/lib/node_modules/npm/node_modules/.bin/is-ci
/usr/local/lib/node_modules/npm/node_modules/.bin/node-gyp
/usr/local/lib/node_modules/npm/node_modules/.bin/opener
/usr/local/lib/node_modules/npm/node_modules/.bin/qrcode-terminal
/usr/local/lib/node_modules/npm/node_modules/.bin/rc
/usr/local/lib/node_modules/npm/node_modules/.bin/semver
/usr/local/lib/node_modules/npm/node_modules/.bin/sshpk-conv
/usr/local/lib/node_modules/npm/node_modules/.bin/sshpk-sign
/usr/local/lib/node_modules/npm/node_modules/.bin/sshpk-verify
/usr/local/lib/node_modules/npm/node_modules/.bin/uuid
/usr/local/lib/node_modules/npm/node_modules/.bin/which
Run Code Online (Sandbox Code Playgroud)
当我尝试时brew prune,我得到:
newmbp$ brew link node
Warning: Already linked: /usr/local/Cellar/node/10.11.0
Run Code Online (Sandbox Code Playgroud)
我注意到文件(要链接或取消链接)位于单独的文件夹中,但一直在努力理解将文件放入/usr/local/Cellarvs的含义/usr/local/lib
导致所有这一切的促成因素是我的笔记本电脑上的风扇时不时地疯狂运转,通常是在 MAMP 运行时。
brew cleanup --prune-prefix(ex- brew prune) 删除了损坏的符号链接,所以问题应该消失了。
brew link node抱怨的事实与此无关;这是一个完全不同的命令。这甚至不是一个错误,只是一个警告:“你让我链接,node但它已经链接了”所以这里一切都很好。
Homebrew 将其文件安装在/usr/local/Cellar. 另一方面,/usr/local/lib是库常用的共享目录。为了让软件找到安装的 libs Homebrew,它会在其中对它们进行符号链接。
例如,假设您有一个foo安装 library的公式版本 1.2.3 bar。运行后brew install foo你应该得到这样的东西:
# the library files
/usr/local/Cellar/foo/1.2.3/lib/bar
# a symlink to the library files from /usr/local/lib
/usr/local/lib/bar -> /usr/local/Cellar/foo/1.2.3/lib/bar
Run Code Online (Sandbox Code Playgroud)
如果是brew uninstall foo,它会同时删除库文件和符号链接。
可以使用brew unlink <formula>(删除它们)和brew link <formula>(添加它们)来操作这些 Homebrew 符号链接。为你brew install运行brew link,所以你不需要。这就是您收到警告的原因:您的 Node 符号链接已经存在。
brew doctor执行各种检查,包括check_for_broken_symlinks. 这个查看目录,例如/usr/local/var或/usr/local/lib损坏的符号链接。损坏的符号链接是其目标不存在的符号链接,通常是因为它已被删除。
这里要理解的重点是 Homebrew 会查看所有符号链接,而不仅仅是它创建的符号链接。损坏的符号链接可能会导致问题,这就是 Homebrew 警告您有关它们的原因,但如果一切正常,您可以随意忽略警告。
| 归档时间: |
|
| 查看次数: |
4604 次 |
| 最近记录: |