New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems on Mavericks with only Command Line Tools installed #341

Closed
OliverJAsh opened this Issue Oct 28, 2013 · 78 comments

Comments

Projects
None yet
@OliverJAsh
Copy link

OliverJAsh commented Oct 28, 2013

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.

@andessen

This comment has been minimized.

Copy link

andessen commented Oct 29, 2013

+1

1 similar comment
@kahwee

This comment has been minimized.

Copy link

kahwee commented Oct 29, 2013

+1

@w0rm

This comment has been minimized.

Copy link

w0rm commented Oct 29, 2013

I also have this problem, don't really want to install xcode.

@tonyyates

This comment has been minimized.

Copy link

tonyyates commented Oct 31, 2013

+1

2 similar comments
@freidamachoi

This comment has been minimized.

Copy link

freidamachoi commented Nov 4, 2013

+1

@wildjcrt

This comment has been minimized.

Copy link

wildjcrt commented Nov 4, 2013

+1

@btmills

This comment has been minimized.

Copy link

btmills commented Nov 4, 2013

Had this same error installing contextify as pert of jsdom on a clean install of Mavericks. Unfortunately the workaround was to install Xcode.

@prestonparris

This comment has been minimized.

Copy link

prestonparris commented Nov 6, 2013

Installing the latest version of command line tools for mavericks fixed the issue for me.

@gregdillon

This comment has been minimized.

Copy link

gregdillon commented Nov 9, 2013

Hmmm...Still not working for me.

@shaneog

This comment has been minimized.

Copy link

shaneog commented Nov 10, 2013

👍 Latest Command Line Tools (late October) don't work for me either

@HyShai

This comment has been minimized.

Copy link

HyShai commented Nov 12, 2013

+1

@TooTallNate

This comment has been minimized.

Copy link
Contributor

TooTallNate commented Nov 12, 2013

Everyone please try node-gyp v0.12.1 please. This is hopefully fixed.

@HyShai

This comment has been minimized.

Copy link

HyShai commented Nov 12, 2013

Still getting the error.

gyp ERR! node-gyp -v v0.12.1
@TooTallNate

This comment has been minimized.

Copy link
Contributor

TooTallNate commented Nov 18, 2013

I'm getting reports that this is still an issue. Reopening.

However, it's an upstream gyp issues. Has anybody reported an issue on the gyp issue tracker that we can reference for here?

@victorhooi

This comment has been minimized.

Copy link

victorhooi commented Nov 21, 2013

Hi,

I can confirm that I have this issue as well.

OSX 10.9 (Mavericks) with Command Line Tools for Mavericks (Late October) installed.

I've raised an issue with the Gyp project here:

https://code.google.com/p/gyp/issues/detail?id=383&thanks=383&ts=1385034279

Is that what you meant? I don't know much about the background to this issue - so if somebody (e.g. @TooTallNate ) could add proper details, that would be great.

Cheers,
Victor

@yixizhang

This comment has been minimized.

Copy link

yixizhang commented Nov 26, 2013

+1

@yixizhang

This comment has been minimized.

Copy link

yixizhang commented Nov 28, 2013

Installing XCode as a whole fixed the problem for me.

@robrobbins

This comment has been minimized.

Copy link

robrobbins commented Nov 28, 2013

+1 . Installing XCode but only because of this...

@Paxa

This comment has been minimized.

Copy link

Paxa commented Dec 1, 2013

suks :(

@breeswish

This comment has been minimized.

Copy link

breeswish commented Dec 2, 2013

I have installed the whole xcode but still get this error :( any ideas?

@akougblenou

This comment has been minimized.

Copy link

akougblenou commented Dec 2, 2013

I am running on Mac OS X 10.7.5, I already had Xcode installed (v. 4.6.2) and just recently installed Command Line Tools but it is still not working. Any ideas?

@victorhooi

This comment has been minimized.

Copy link

victorhooi commented Dec 2, 2013

Hi,

Is there any word on whether this will eventually work with just Command Line Tools, and not the full XCode suite?

It seems a bit weird to have to install 4-5 Gb worth of XCode, just to get this one thing to compile.

Cheers,
Victor

@Chicooz

This comment has been minimized.

Copy link

Chicooz commented Dec 11, 2013

yes this sucks , i need a solution for this guys

@Chicooz

This comment has been minimized.

Copy link

Chicooz commented Dec 11, 2013

i have xcode installed and i get the same issue

@dankohn

This comment has been minimized.

Copy link

dankohn commented Dec 11, 2013

Until this is fixed, the workaround to use node-gyp on Mavericks is:

  1. Install XCode from the App Store
  2. In terminal, enter sudo xcode-select /Applications//Xcode.app/Contents/Developer/
@giancarlo3g

This comment has been minimized.

Copy link

giancarlo3g commented Dec 11, 2013

+1

1 similar comment
@Pazzilivo

This comment has been minimized.

Copy link

Pazzilivo commented Dec 12, 2013

+1

@TooTallNate TooTallNate reopened this Dec 12, 2013

@TooTallNate

This comment has been minimized.

Copy link
Contributor

TooTallNate commented Dec 12, 2013

Guys, I've reopened the ticket since this is apparently still an issue, but please stop +1'ing it here. There's really nothing I can do, it's up to the Google guys at this point: https://code.google.com/p/gyp/issues/detail?id=383

@Poohblah

This comment has been minimized.

Copy link

Poohblah commented Feb 10, 2014

Zach, I’d like to know as well. I feel a little iffy about it myself. I honestly have no clue, because I’ve never built anything using the XCode development environment.

On Feb 9, 2014, at 6:08 PM, Zach Harkey notifications@github.com wrote:

I followed @Poohblah's recommendation and added a stub executable to my PATH and it fixed my immediate problems. But it feels pretty sketchy. Can anyone advise if this is gonna bite us in the ass later?


Reply to this email directly or view it on GitHub.

@ishanagr

This comment has been minimized.

Copy link

ishanagr commented Jul 1, 2014

Thanks @Poohblah your suggestion fixed it for me 👍

@mtheoryx

This comment has been minimized.

Copy link

mtheoryx commented Jul 18, 2014

Any update on a better solution?

@jesstelford

This comment has been minimized.

Copy link

jesstelford commented Aug 26, 2014

Whilst @Poohblah's solution works (and is the only solution that worked in this thread), I feel there has to be a better fix than this!

@TooTallNate - is this something you can fix again? I'm using node-gyp 1.0.1, and have made sure my npm version is using 1.0.1 too.

@whmountains

This comment has been minimized.

Copy link

whmountains commented Oct 7, 2014

Any better solution?

@cburmeister

This comment has been minimized.

Copy link

cburmeister commented Feb 11, 2015

This still hasn't been fixed? I really, really do not want to install Xcode.

@jesstelford

This comment has been minimized.

Copy link

jesstelford commented Feb 11, 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.

@neverfox

This comment has been minimized.

Copy link

neverfox commented Mar 10, 2015

I get this warning (whether I use 0.10, 0.11, 0.12, or io.js) but then everything seems to work fine anyway. I do get output from which xcodebuild (/usr/bin/xcodebuild) FWIW. I would prefer not to get the warning though, obviously, as it makes one wonder if everything is really alright.

@ilei

This comment has been minimized.

Copy link

ilei commented Mar 12, 2015

Can you give me an answer?

@jesstelford

This comment has been minimized.

Copy link

jesstelford commented Mar 12, 2015

@ilei 42.

@Ajithsou

This comment has been minimized.

Copy link

Ajithsou commented Mar 25, 2015

I have faced the same problem and resolved by installing the xcode6.

@HipsterZipster

This comment has been minimized.

Copy link

HipsterZipster commented May 15, 2015

Problem still exists in Yosemite. Wish there was a way NOT to install 3GB xcode 👎

@prashcr

This comment has been minimized.

Copy link

prashcr commented Jul 6, 2015

Not 3GB. Fully installed Xcode is 6GB according to AppCleaner, probably including libraries and frameworks outside Xcode. Utterly ridiculous that I have to give up 6GB on my 100GB SSD for something I'll never use.

@itajaja

This comment has been minimized.

Copy link

itajaja commented Jul 27, 2015

thanks @jesstelford, your solution worked perfectly! 👍

@u2

This comment has been minimized.

Copy link

u2 commented Aug 4, 2015

Thanks @Poohblah, it works for me.

@bdwyertech

This comment has been minimized.

Copy link

bdwyertech commented Sep 2, 2015

You can also symlink /usr/local/bin/xcodebuild to /usr/bin/true

# Fix XcodeBuild Issue
if [[ -d '/Applications/XCode.app' ]] || [[ -d '/Developer/Applications/XCode.app' ]]; then
  echo 'Xcode Seems to be installed...'
else
  if [[ ! $(xcodebuild | grep 'requires Xcode') ]]; then
    echo 'Fixing the Xcodebuild issue by symlinking xcodebuild to true'
    ln -s /usr/bin/true /usr/local/bin/xcodebuild
    source '/etc/profile'
  fi
fi
@cebor

This comment has been minimized.

Copy link

cebor commented Sep 21, 2015

Also getting this error ...

@mourner

This comment has been minimized.

Copy link

mourner commented Dec 8, 2015

ln -s /usr/bin/true /usr/local/bin/xcodebuild hint by @bdwyertech works perfectly, although I'm still not sure whether it has any unwanted side effects.

@jelpern

This comment has been minimized.

Copy link

jelpern commented Jan 27, 2016

I'm also getting this error. @bdwyertech @mourner can you explain where to put this code and how to run it, for someone who is less familiar with bash scripts?

Has anyone confirmed whether this works on El Capitan?

The only silver lining I've seen is that Xcode seems to have dropped in size down to only 4GB ...

@MarcDiethelm

This comment has been minimized.

Copy link

MarcDiethelm commented Mar 7, 2016

@jelpern: @bdwyertech's script (thank you!!) works for me under El Capitan (OSX 10.11). You can just put it in a new file anywhere, and call it e.g. fix-xcodeless-build.sh. Make it executable chmod +x fix-xcodeless-build.sh. And run it: sudo ./fix-xcodeless-build.sh.

@jelpern

This comment has been minimized.

Copy link

jelpern commented Mar 25, 2016

Thank you @MarcDiethelm. Would there be any downside to putting this in my .bash_profile? Also why does this need to be run as sudo?

@tcelestino

This comment has been minimized.

Copy link

tcelestino commented Apr 15, 2016

Thanks @jesstelford, your solution worked for me on El Capitan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment