question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems on Mavericks with only Command Line Tools installed

See original GitHub issue

I have installed the Command Line Tools:

$ xcode-select --print-path
/Library/Developer/CommandLineTools

However, when anything tries to use node-gyp, I get the following error:

$ npm install bcrypt
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0

> bcrypt@0.7.7 install /Users/Oliver/Development/sbscribe/node_modules/bcrypt
> node-gyp rebuild

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

gyp: Error 1 running xcodebuild
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Oliver/Development/sbscribe/node_modules/bcrypt
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

On Mountain Lion it was possible to use this without installing the whole of Xcode, rather just the Command Line Tools. Is it possible to do this on Mavericks? How can I get it working?

N.B. This is on a clean install of Mavericks.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:78 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
jesstelfordcommented, Mar 5, 2015

To re-iterate @Poohblah’s solution:

The Error

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

The Solution

  1. Run which xcodebuild in the terminal. If it gives no output, continue to step 2. If it gives output, then this solution will not work for you.

  2. Create a file /usr/local/bin/xcodebuild. In that file, use your favourite editor to add the contents:

    #!/bin/bash
    
    exit 0
    
  3. Save that file, and exit your editor.

  4. Give the file the correct permissions by running sudo chmod a+x /usr/local/bin/xcodebuild

  5. You’re done! Re-run he command that caused the error.

3reactions
jesstelfordcommented, Mar 12, 2015

@ilei 42.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to use xcodebuild on Mavericks with Command Line ...
It appears that OSX has changed xcodebuild to require XCode to be installed, where before it functioned properly with only the OSX Command...
Read more >
[Solved]-Failed to install command line tools on OSX Mavericks
Install them from here. You must be a registered developer. Other solution is: in xcode click Xcode>Open Developer Tool>More Developer Tools.
Read more >
How can I install the Command Line Tools completely from the ...
It appears to use /System/Library/CoreServices/Install Command Line Developer Tools.app to do this. I would like to use the same mechanism that ...
Read more >
How to Install Command Line Tools in Mac OS X (Without ...
The Command Line Tool package gives Mac terminal users many commonly used tools, utilities, and compilers, including make, GCC, clang, perl, svn ...
Read more >
Installing Command Line Tools automatically on Mavericks
In Mavericks, the Xcode Command Line Tools can be downloaded from the ADC downloads page like with previous versions. Now, though, they can ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found