Can't `brew link` an unlinked keg

匿名 (未验证) 提交于 2019-12-03 02:45:02

问题:

$: which node $: node -bash: node: command not found $: brew install node Error: node-0.6.18 already installed $: brew doctor Error: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built.  node  $: brew link node Error: No such file or directory - /usr/local/Cellar/node/0.6.5 $: brew uninstall node Error: No such file or directory - /usr/local/Cellar/node/0.6.5 $: brew install node Error: node-0.6.18 already installed 

How do I get my node back on track??

回答1:

I was able to relink the correct version of node by running:

brew cleanup brew link node brew uninstall node brew install node 


回答2:

To force the link and overwrite all conflicting files:

brew link --overwrite node 


回答3:

I was getting:

$ brew link node Error: No such keg: /usr/local/Cellar/node $ brew link node@8 Warning: node@8 is keg-only and must be linked with --force 

That command helped to get everything working again:

brew link --overwrite --force node@8 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!