個人Mac使用homebrew管理,因而我使用brew install gdb
命令直接安裝gdb,結果以下:
node
我在stackoverflow找到了發生的相似狀況,通過閱讀判斷,找到了一下兩種解決辦法:app
命令內容:測試
sudo chown -R `whoami`:admin /usr/local/bin
homebrew doctor
進行檢測,根據其反饋來進行操做:我認爲應該使用第二中方法比較好,因而我在終端輸入homebrew doctor
,稍做等待獲得檢測結果:
this
如劃紅線部分所示,與我遇到的問題相符合,運行其解決方案:
sudo chown -R $(whoami) /usr/local/bin
在此時再link一下個人GDB:
brew link gdb
結果以下:
Already linked: /usr/local/Cellar/gdb/8.0.1
再測試一下GDB:
gdb
結果以下:
成功..net
sudo make install
命令,致使了一些軟件非homebrew管理,因此homebrew在Link的時候會出現問題。homebrew doctor
以下提示:This can happen if you "sudo make install" software that isn't managed by Homebrew. If a formula tries to write a file to this directory, the install will fail during the link step. You should change the ownership and permissions of these directories. back to your user account.
用brew安裝node遇到的問題
Error: The 'brew link' step did not complete successfully
homebrew could not symlink usr/local/bin is not writablecode