1. 程式人生 > >MacOS High Sierra 10.13.6上安裝LeanCloud命令列工具CLI

MacOS High Sierra 10.13.6上安裝LeanCloud命令列工具CLI

簡介

根據本人分析(供參考),LeanCloud和mbmod是時下國內非常流行的兩家雲API供應商,其主要市場瞄準移動開發。有關細節在此不贅述,有興趣的朋友可以參考官方網站有關資料。本文介紹在MacOS High Sierra 10.13.6上安裝LeanCloud命令列工具CLI的注意事項。


命令列工具是用來管理和部署雲引擎專案的工具。它不僅可以部署、釋出和回滾雲引擎程式碼,對同一個雲引擎專案做多應用管理,還能檢視雲引擎日誌,批量將檔案上傳到 LeanCloud 雲端。可以說,lean-cli命令列工具是基於LeanCloud進行雲開發和除錯的主要工具。

但是,在MacOS High Sierra 10.13.6上安裝LeanCloud命令列工具有幾個特別點值得注意。


問題及方案

如果直接按照官方下列命令操作,很可能失敗:


brew update

brew install lean-cli


(1)命令brew update在最新的MacOS High Sierra 10.13.6上安裝LeanCloud命令列工具必然失敗!只能解除安裝brew後重新安裝之。解除安裝brew命令如下:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"


(2)重新安裝brew命令如下:
/usr/bin/ruby -e "$(curl -fsSL

https://raw.githubusercontent.com/Homebrew/install/master/install)"


(3)使用brew安裝LeanCloud命令列工具


brew install lean-cli


成功安裝後命令行顯示如下:


==> Downloading https://homebrew.bintray.com/bottles/lean-cli-0.20.0.high_sierra.bottle.tar.gz

######################################################################## 100.0%

==> Pouring lean-cli-0.20.0.high_sierra.bottle.tar.gz

==> Caveats

Bash completion has been installed to:

/usr/local/etc/bash_completion.d

zsh completions have been installed to:

/usr/local/share/zsh/site-functions

==> Summary


引用

  1. https://leancloud.cn/docs/leanengine_cli.html
  2. https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx-10-13-high-sierra
  3. https://www.jianshu.com/p/9474dba212f8
  4. https://blog.csdn.net/imliutao2/article/details/78675597