第一步:安装homebrew(安装过就跳过)
第二步 命令行输入
brew tap azure/functions
brew install azure-functions-core-tools@4
# if upgrading on a machine that has 2.x or 3.x installed:
brew link --overwrite azure-functions-core-tools@4
报错:
brew link --overwrite azure-functions-core-tools@4
Warning: azure/functions/azure-functions-core-tools@4 4.0.3971 is already installed and up-to-date.
To reinstall 4.0.3971, run:
brew reinstall azure-functions-core-tools@4
zsh: command not found: #
Warning: Already linked: /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.3971
To relink, run:
brew unlink azure-functions-core-tools@4 && brew link azure-functions-core-tools@4
按照它说的重新安装 brew reinstall azure-functions-core-tools@4
reinstall后显示:
brew link --overwrite azure-functions-core-tools@4
Warning: azure/functions/azure-functions-core-tools@4 4.0.3971 is already installed and up-to-date.
To reinstall 4.0.3971, run:
brew reinstall azure-functions-core-tools@4
zsh: command not found: #
Warning: Already linked: /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.3971
To relink, run:
brew unlink azure-functions-core-tools@4 && brew link azure-functions-core-tools@4
brew link azure-functions-core-tools@4
Warning: Already linked: /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.3971
To relink, run:
brew unlink azure-functions-core-tools@4 && brew link azure-functions-core-tools@4
第三步,按它说的brew unlink azure-functions-core-tools,显示:
Unlinking /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.3971... 1 symlinks removed
第四步,输入brew link azure-functions-core-tools@4
检查是否安装成功:输入 func -v
显示
func4.0.3971
-v%
就表示安装成功