Skip to content

Commit 3e4d76e

Browse files
committed
doc: introduce remote acid test
1 parent 7c34404 commit 3e4d76e

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

acid-test.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
pkgs=(
4+
"com.apple.pkg.DeveloperToolsCLILeo" # standalone
5+
"com.apple.pkg.DeveloperToolsCLI" # from XCode
6+
"com.apple.pkg.CLTools_Executables" # Mavericks
7+
)
8+
9+
for pkg in "${pkgs[@]}"; do
10+
output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null)
11+
if [ "$output" ]; then
12+
version=$(echo "$output" | grep 'version' | cut -d' ' -f2)
13+
break
14+
fi
15+
done
16+
17+
if [ "$version" ]; then
18+
echo "Command Line Tools version: $version"
19+
else
20+
echo >&2 'Command Line Tools not found'
21+
fi

macOS_Catalina.md

+3-18
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,13 @@ If `ProductVersion` is less then `10.15` then this document is not for you. Norm
1818
### The acid test
1919
To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run:
2020
```
21-
/usr/sbin/pkgutil --pkgs |
22-
grep -i com.apple.pkg.cltools |
23-
head -n1 |
24-
xargs -n1 /usr/sbin/pkgutil --pkg-info
21+
curl -L https://git.io/node-gyp:acid-test | bash
2522
```
2623

27-
Test output format is:
28-
```
29-
package-id: com.apple.pkg.CLTools_Executables
30-
version: 11.4.1.0.1.1586360307
31-
volume: /
32-
location: /
33-
install-time: 1587769775
34-
groups: com.apple.FindSystemFiles.pkg-group
35-
```
36-
**`version: 11.0.0` (or later) should be listed.**
37-
38-
If test did not produce any output
39-
or expected version isn't listed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions).
40-
4124
If test succeeded, _you are done_! You should be ready to install `node-gyp`.
4225

26+
If test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions).
27+
4328
### Solutions
4429
There 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.
4530

0 commit comments

Comments
 (0)