Skip to content

Instantly share code, notes, and snippets.

@jens1101
Last active March 23, 2023 08:55
Show Gist options
  • Save jens1101/ffa366b341e4511cedd2057f100e84b5 to your computer and use it in GitHub Desktop.
Save jens1101/ffa366b341e4511cedd2057f100e84b5 to your computer and use it in GitHub Desktop.
Fix "gyp: No Xcode or CLT version" on MacOS

This error happens when the command line tools on MacOS are not installed correctly. Do the following to fix this problem:

  1. Test if the command line tools are working. Run:
    curl -sL https://raw.githubusercontent.com/nodejs/node-gyp/main/macOS_Catalina_acid_test.sh | bash
  2. If the above retruns something like "Command Line Tools not found" then run the following:
    sudo rm -rf $(xcode-select --print-path)
    xcode-select --install
  3. Click on "Install" in the prompt
  4. Agree to the terms and conditions
  5. Wait for installation to finish
  6. Test again if the command line tools are working. It should be fixed now.

If you still have issues then see this article by node-gyp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment