UNPKG

4.97 kBMarkdownView Raw
1# Installation notes for macOS Catalina (v10.15)
2
3_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 when future Catalina versions no longer raise these issues._
4
5**Upgrading to macOS Catalina may cause normal `node-gyp` installations to fail.**
6
7### Is my Mac running macOS Catalina?
8Let's first make sure that your Mac is running Catalina:
9```
10% sw_vers
11 ProductName: Mac OS X
12 ProductVersion: 10.15
13 BuildVersion: 19A602
14```
15If `ProductVersion` is less then `10.15` then this document is not for you. Normal install docs for `node-gyp` on macOS can be found at https://github.com/nodejs/node-gyp#on-macos
16
17
18### The acid test
19To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run:
201. `/usr/sbin/pkgutil --packages | grep CL`
21 * `com.apple.pkg.CLTools_Executables` should be listed. If it isn't, this test failed.
222. `/usr/sbin/pkgutil --pkg-info com.apple.pkg.CLTools_Executables`
23 * `version: 11.0.0` (or later) should be listed. If it isn't, this test failed.
24
25If both tests succeeded, _you are done_! You should be ready to install `node-gyp`.
26
27If either test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions).
28
29### Solutions
30There are three ways to install the Xcode libraries `node-gyp` needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable.
31
321. With the full Xcode (~7.6 GB download) from the `App Store` app.
332. With the _much_ smaller Xcode Command Line Tools via `xcode-select --install`
343. With the _much_ smaller Xcode Command Line Tools via manual download. **For people running the latest version of Catalina (10.15.2 at the time of this writing), this has worked when the other two solutions haven't.**
35
36### Installing `node-gyp` using the full Xcode
371. `xcodebuild -version` should show `Xcode 11.1` or later.
38 * If not, then install/upgrade Xcode from the App Store app.
392. Open the Xcode app and...
40 * Under __Preferences > Locations__ select the tools if their location is empty.
41 * Allow Xcode app to do an essential install of the most recent compiler tools.
423. Once all installations are _complete_, quit out of Xcode.
434. `sudo xcodebuild -license accept` # If you agree with the licensing terms.
445. `softwareupdate -l` # No listing is a good sign.
45 * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them.
466. `xcode-select -version` # Should return `xcode-select version 2370` or later.
477. `xcode-select -print-path` # Should return `/Applications/Xcode.app/Contents/Developer`
488. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready.
499. If the _acid test_ does _not_ pass then...
5010. `sudo xcode-select --reset` # Enter root password. No output is normal.
5111. Repeat step 7 above. Is the path different this time? Repeat the _acid test_.
52
53### Installing `node-gyp` using the Xcode Command Line Tools via `xcode-select --install`
541. If the _acid test_ has not succeeded, then try `xcode-select --install`
552. Wait until the install process is _complete_.
563. `softwareupdate -l` # No listing is a good sign.
57 * If Xcode or Tools upgrades are listed, use "Software Update" to install them.
584. `xcode-select -version` # Should return `xcode-select version 2370` or later.
595. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools`
606. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready.
617. If the _acid test_ does _not_ pass then...
628. `sudo xcode-select --reset` # Enter root password. No output is normal.
639. Repeat step 5 above. Is the path different this time? Repeat the _acid test_.
64
65### Installing `node-gyp` using the Xcode Command Line Tools via manual download
661. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from developer.apple.com/download. As of MacOS 10.15.2, that's Command_Line_Tools_for_Xcode_11.3.dmg
672. Install the package.
683. Run the _acid test_.
69
70### I did all that and the acid test still does not pass :-(
711. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal.
722. `xcode-select --install`
733. If the [_acid test_](#The-acid-test) still does _not_ pass then...
744. `npm explore npm -g -- npm install node-gyp@latest`
755. `npm explore npm -g -- npm explore npm-lifecycle -- npm install node-gyp@latest`
766. If the _acid test_ still does _not_ pass then...
777. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve.
78
79Lessons learned from:
80* https://github.com/nodejs/node-gyp/issues/1779
81* https://github.com/nodejs/node-gyp/issues/1861
82* https://github.com/nodejs/node-gyp/issues/1927 and elsewhere
83* Thanks to @rrrix for discovering Solution 3