3.9 KiB
Executable File
Installation notes for macOS Catalina (v10.15)
This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or updated to deal with challenges involved in upgrades to the next version of macOS.
Lessons learned from:
- https://github.com/nodejs/node-gyp/issues/1779
- https://github.com/nodejs/node-gyp/issues/1861
- https://github.com/nodejs/node-gyp/issues/1927 and elsewhere
Installing node-gyp
on macOS can be found at https://github.com/nodejs/node-gyp#on-macos
However, upgrading to macOS Catalina changes some settings that may cause normal node-gyp
installations to fail.
Is my Mac running macOS Catalina?
Let's make first make sure that your Mac is currently running Catalina:
% sw_vers
ProductName: Mac OS X
ProductVersion: 10.15
BuildVersion: 19A602
If ProductVersion
is less then 10.15
then this document is not really for you.
The acid test
Next, lets see if Xcode Command Line Tools
are installed:
/usr/sbin/pkgutil --packages | grep CL
- If nothing is listed, then skip to the next section.
- If
com.apple.pkg.CLTools_Executables
is listed then try:
/usr/sbin/pkgutil --pkg-info com.apple.pkg.CLTools_Executables
- If
version: 11.0.0
or later is listed then you are done! Your Mac should be ready to installnode-gyp
. Doingclang -v
should showApple clang version 11.0.0
or later.
- If
As you go through the remainder of this document, at anytime you can try these acid test
commands. If they pass then your Mac should be ready to install node-gyp
.
Two roads
There are two main ways to install node-gyp
on macOS:
- With the full Xcode (~7.6 GB download) from the
App Store
app. - With the much smaller Xcode Command Line Tools via
xcode-select --install
Installing node-gyp
using the full Xcode
xcodebuild -version
should showXcode 11.1
or later.- If not, then install/upgrade Xcode from the App Store app.
- Open the Xcode app and allow it to do an essential install of the most recent compiler tools.
- Once all installations are complete, quit out of Xcode.
sudo xcodebuild -license accept
# If you agree with the licensing terms.softwareupdate -l
# No listing is a good sign.- If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them.
xcode-select -version
# Should returnxcode-select version 2370
or later.xcode-select -print-path
# Should return/Applications/Xcode.app/Contents/Developer
- Try the acid test steps above to see if your Mac is ready.
- If the acid test does not pass then...
sudo xcode-select --reset
# Enter root password. No output is normal.- Repeat step 7 above. Is the path different this time? Repeat the acid test.
Installing node-gyp
using the Xcode Command Line Tools
- If the acid test has not succeeded, then try
xcode-select --install
- Wait until the install process is complete.
softwareupdate -l
# No listing is a good sign.- If Xcode or Tools upgrades are listed, use "Software Update" to install them.
xcode-select -version
# Should returnxcode-select version 2370
or later.xcode-select -print-path
# Should return/Library/Developer/CommandLineTools
- Try the acid test steps above to see if your Mac is ready.
- If the acid test does not pass then...
sudo xcode-select --reset
# Enter root password. No output is normal.- Repeat step 5 above. Is the path different this time? Repeat the acid test.
I did all that and the acid test still does not pass :-(
sudo rm -rf $(xcode-select -print-path)
# Enter root password. No output is normal.xcode-select --install
- If the acid test still does not pass then...
- Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve.