Fix the 'gcloud command not found' error in macOS

  1. Download google-cloud-sdk.tar.gz, and unzip it. Place the unzipped folder whenever you want (I've place it in the macOS Applications folder).

  2. Go to the folder:

terminal
cd /Applications/google-cloud-sdk
  1. Install the package:
terminal
./install.sh
  1. While running the installation:
terminal
Modify profile to update your $PATH and enable shell command completion?

Do you want to continue (Y/n)?  

y
  1. By default, the executable will modify the /Users/Erik/.bash_profile file, but after installation, if you execute gcloud --version and the command is not found, reinstall the package and replace /Users/Erik/.bash_profile with ~/.profile.

  2. Restart the terminal.

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.