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

这个错误可能是由两个原因引起的。

 

xcode

重装 xcode

$ sudo rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install

参见 https://github.com/nodejs/node-gyp/issues/569

node-gyp

重装 node-gyp。例如直接用 nvm 装一个新版的 node 即可。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s