From e6aca7d8aa98bc4fa22522bab874765650249cf6 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 23 Oct 2019 18:33:49 -0400 Subject: [PATCH 1/9] src,win: allow 403 errors for arm64 node.lib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The servers hosting the header packages for Electron return 403 instead of 404 for the constructed URL for arm64 node.lib for older releases that do not support arm64. PR-URL: https://github.com/nodejs/node-gyp/pull/1934 Reviewed-By: Rod Vagg Reviewed-By: João Reis --- lib/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/install.js b/lib/install.js index 06e82871f7..f68cd7fd6d 100644 --- a/lib/install.js +++ b/lib/install.js @@ -323,7 +323,7 @@ function install (fs, gyp, argv, callback) { req.on('error', done) req.on('response', function (res) { - if (res.statusCode === 404) { + if (res.statusCode === 403 || res.statusCode === 404) { if (arch === 'arm64') { // Arm64 is a newer platform on Windows and not all node distributions provide it. log.verbose(`${name} was not found in ${libUrl}`) From a7661bb043b9227d8316b7b38d5f853dc6dc7075 Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 25 Oct 2019 12:50:43 +0200 Subject: [PATCH 2/9] build: Add macOS_Catalina.md document --- macOS_Catalina.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 macOS_Catalina.md diff --git a/macOS_Catalina.md b/macOS_Catalina.md new file mode 100644 index 0000000000..2e2984f321 --- /dev/null +++ b/macOS_Catalina.md @@ -0,0 +1,68 @@ +# Installation notes for macOS Catalina (v10.15) + +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: +1. `/usr/sbin/pkgutil --packages | grep CL` + * If nothing is listed, then [skip to the next section](#Two-roads). + * If `com.apple.pkg.CLTools_Executables` is listed then try: +2. `/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 install `node-gyp`. Doing `clang -v` should show `Apple clang version 11.0.0` or later. + +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: +1. With the full Xcode (~7.6 GB download) from the `App Store` app. +2. With the _much_ smaller Xcode Command Line Tools via `xcode-select -install` + +### Installing `node-gyp` using the full Xcode +1. `xcodebuild -version` should show `Xcode 11.1` or later. + * If not, then install/upgrade Xcode from the App Store app. +2. Open the Xcode app and allow it to do an essential install of the most recent compiler tools. +3. Once all installations are _complete_, quit out of Xcode. +4. `sudo xcodebuild -license accept` # If you agree with the licensing terms. +5. `softwareupdate -l` # No listing is a good sign. + * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them. +6. `xcode-select -version` # Should return `xcode-select version 2370` or later. +7. `xcode-select -print-path` # Should return `/Applications/Xcode.app/Contents/Developer` +8. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. +9. If the _acid test_ does _not_ pass then... +10. `sudo xcode-select --reset` # Enter root password. No output is normal. +11. Repeat step 7 above. Is the path different this time? Repeat the _acid test_. +12. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. + +### Installing `node-gyp` using the Xcode Command Line Tools +1. If the _acid test_ has not succeeded, then try `xcode-select --install` +2. Wait until the install process is _complete_. +3. `softwareupdate -l` # No listing is a good sign. + * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them. +4. `xcode-select -version` # Should return `xcode-select version 2370` or later. +5. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` +6. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. +7. If the _acid test_ does _not_ pass then... +8. `sudo xcode-select --reset` # Enter root password. No output is normal. +9. 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 :-( +1. `sudo rm -fm $(xcode-select -print-path)` # Enter root password. No output is normal. +2. `xcode-select --install` +3. If the [_acid test_](#The-acid-test) still does _not_ pass then... +4. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. From f25a41f7fe63bff810a49f83def998508be8709f Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 25 Oct 2019 13:11:21 +0200 Subject: [PATCH 3/9] fixup: typos --- macOS_Catalina.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macOS_Catalina.md b/macOS_Catalina.md index 2e2984f321..b55672ec27 100644 --- a/macOS_Catalina.md +++ b/macOS_Catalina.md @@ -47,7 +47,6 @@ There are two main ways to install `node-gyp` on macOS: 9. If the _acid test_ does _not_ pass then... 10. `sudo xcode-select --reset` # Enter root password. No output is normal. 11. Repeat step 7 above. Is the path different this time? Repeat the _acid test_. -12. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. ### Installing `node-gyp` using the Xcode Command Line Tools 1. If the _acid test_ has not succeeded, then try `xcode-select --install` @@ -62,7 +61,7 @@ There are two main ways to install `node-gyp` on macOS: 9. 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 :-( -1. `sudo rm -fm $(xcode-select -print-path)` # Enter root password. No output is normal. +1. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal. 2. `xcode-select --install` 3. If the [_acid test_](#The-acid-test) still does _not_ pass then... 4. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. From f21b98404f039a5aae3d9856d6d81b21069ebfe9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 30 Oct 2019 17:58:00 +0100 Subject: [PATCH 4/9] Add Time To Live statement to the document --- macOS_Catalina.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macOS_Catalina.md b/macOS_Catalina.md index b55672ec27..4275a0604c 100644 --- a/macOS_Catalina.md +++ b/macOS_Catalina.md @@ -1,5 +1,7 @@ # 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 From e6d193275acc4e778cc1136a56a9ee7528891087 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 30 Oct 2019 17:59:49 +0100 Subject: [PATCH 5/9] fixup: revert all changes to install.js --- lib/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/install.js b/lib/install.js index f68cd7fd6d..06e82871f7 100644 --- a/lib/install.js +++ b/lib/install.js @@ -323,7 +323,7 @@ function install (fs, gyp, argv, callback) { req.on('error', done) req.on('response', function (res) { - if (res.statusCode === 403 || res.statusCode === 404) { + if (res.statusCode === 404) { if (arch === 'arm64') { // Arm64 is a newer platform on Windows and not all node distributions provide it. log.verbose(`${name} was not found in ${libUrl}`) From 6ee07ffa8ad5deeeba6855638dae17278ee116f0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 30 Oct 2019 18:08:34 +0100 Subject: [PATCH 6/9] Add link from README.md to notes-on-macOS-Catalina --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5d4beaae3a..b4da0c64f0 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Depending on your operating system, you will need to install: * `Python v2.7, v3.5, v3.6, or v3.7` * [Xcode](https://developer.apple.com/xcode/download/) * You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`. + * If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [notes-on-macOS-Catalina.md](notes-on-macOS-Catalina.md). ### On Windows From 98b631f364c190a29370df3839b5dfe6c3fab358 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 30 Oct 2019 18:18:23 +0100 Subject: [PATCH 7/9] fixup: macOS_Catalina.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4da0c64f0..9b1c171305 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Depending on your operating system, you will need to install: * `Python v2.7, v3.5, v3.6, or v3.7` * [Xcode](https://developer.apple.com/xcode/download/) * You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`. - * If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [notes-on-macOS-Catalina.md](notes-on-macOS-Catalina.md). + * If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [macOS_Catalina.md](macOS_Catalina.md). ### On Windows From 30ce8eb7189fbb01dc1b9d04d364635b1e64e00a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 30 Oct 2019 19:47:06 +0100 Subject: [PATCH 8/9] fixup: Update macOS_Catalina.md Co-Authored-By: Ted Morin --- macOS_Catalina.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macOS_Catalina.md b/macOS_Catalina.md index 4275a0604c..3e4aeb08ea 100644 --- a/macOS_Catalina.md +++ b/macOS_Catalina.md @@ -54,7 +54,7 @@ There are two main ways to install `node-gyp` on macOS: 1. If the _acid test_ has not succeeded, then try `xcode-select --install` 2. Wait until the install process is _complete_. 3. `softwareupdate -l` # No listing is a good sign. - * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them. + * If Xcode or Tools upgrades are listed, use "Software Update" to install them. 4. `xcode-select -version` # Should return `xcode-select version 2370` or later. 5. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` 6. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. From 540288015b1f480009fae7798a1b59e049974b50 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 1 Nov 2019 10:36:56 +0100 Subject: [PATCH 9/9] fixup: add the missing dash in "--install" --- macOS_Catalina.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macOS_Catalina.md b/macOS_Catalina.md index 3e4aeb08ea..848c2c5c84 100644 --- a/macOS_Catalina.md +++ b/macOS_Catalina.md @@ -33,7 +33,7 @@ As you go through the remainder of this document, at anytime you can try these ` ### Two roads There are two main ways to install `node-gyp` on macOS: 1. With the full Xcode (~7.6 GB download) from the `App Store` app. -2. With the _much_ smaller Xcode Command Line Tools via `xcode-select -install` +2. With the _much_ smaller Xcode Command Line Tools via `xcode-select --install` ### Installing `node-gyp` using the full Xcode 1. `xcodebuild -version` should show `Xcode 11.1` or later.