DEV Community

loading...

macOS Catalina doesn't like node-gyp

Pacharapol Withayasakpunt
Currently interested in TypeScript, Vue, Kotlin and Python. Looking forward to learning DevOps, though.
・1 min read

It seems to break every time I update macOS (on the OS part).

Not like there is no fix, but it is always so annoying. I am considering Linux or Windows instead now.

https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance #569

davis avatar
davis posted on

EDITED FOR PEOPLE JUST GETTING HERE

See https://github.com/nodejs/node-gyp/issues/569#issuecomment-255589932 and https://github.com/nodejs/node-gyp/issues/569#issuecomment-259421050, the warning can just be ignored. Command Line Tools works fine, you do not need the full Xcode.

See https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md, here and here for more info.

Fix:

xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
Enter fullscreen mode Exit fullscreen mode

then just ignore the warning.

Alternatively if you want you can use the full Xcode.app (if you have it installed) with:

# Change the path if you installed Xcode somewhere else.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Enter fullscreen mode Exit fullscreen mode

If your install is failing

There will be other errors nearer the end, almost certainly issues with the module you're trying to install or a dependency. Please report the error to that project.

If that doesn't work

Are you seeing this when you run node-gyp rebuild or npm install? If not then it's nothing to do with node-gyp, raise a bug with the project you're using.

Saw the following error when running an npm install which required node-gyp... but could be triggered by anything which requires xcode-select.

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

What is the problem?

Xcode is easily what I hate most about macOS.

Discussion (1)

Collapse
eelstork profile image
Tea

Tried on Win yesterday needn't be a smooth alternative.
Afaik best experience should be Linux with Clang.