xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun

Have you upgraded to OS X El Cap­i­tan from App Store ?

Have you sud­denly started get­ting the fol­low­ing error in your project?

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

If yes, then here is the solution

xcode-select --install

Remem­ber, in MAC git is attached to XCode’s Com­mand line tools.


You may also like...

  • Mar­cus Zanona

    Thanks a lot for this. It seems the install flag has a dou­ble dash instead? ‘xcode-select –install‘

  • http://brentdanley.com/ Brent Dan­ley

    Thank you! How­ever, because your dash-dash turned into an mdash, copy/paste doesn’t work. #nowor­ries #igotit

  • http://pebutler3.com P.E. But­ler III

    Thanks!

    • Tim­o­thy Mann

      Fan­tas­tic! Thamk you very much

  • Gar­rett Hampton

    Thanks a ton!!!

  • Mara

    Thank you! Kept me from bust­ing up my home­brew directories.

  • Este­ban Gallego

    Thank you!

  • http://www.brianhokke.nl jus­tas­tranger

    thanks 😀

  • Sandeep Malla

    Does this mean I need to install XCode?

    • Kola Joseph

      I’ve been run­ning the beta of MacOS Sierra for a while now and, apart from the odd nig­gle (which I’ve obvi­ously reported), all has been fine. That was until I went to use my Sub­ver­sion client for the first time…

      xcrun: error: invalid active devel­oper path (/Library/Developer/CommandLineTools), miss­ing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

      Now, the issue here is that the com­mand line tools are either miss­ing or bro­ken. The same hap­pened after El Cap­i­tan, so this appears to be a gen­eral issue and one that, sadly, Apple don’t seem to fix.

      The solu­tion is sim­ply to re-install the required soft­ware again. Open up a Ter­mi­nal win­dow and type the following…

      xcode-select –install

      It will take a short while to down­load and install but it should get you up and work­ing again.

  • http://www.boxofficenews.in/ Ritam Das

    Thanks, sim­plest solution

  • Car­los Roso

    You deserve a medal sir

  • Hamada Sidi Fahari

    Thanks 😉

  • http://n3rve.com Ralph Roth­schild

    Great 🙂

  • http://petemoore.github.io/ Peter Moore

    Bril­liant, many thanks!

  • rwx­pro

    Thank you­uuu!

  • goochin

    it work!! thx~~

  • http://julces.com/ Julio Cesar Martin

    like a sharm! thanks

  • Noel H

    Woooo!! nice, thanks a lot!!

  • Aditya Ghadi­gaonkar

    Thanks a lot 🙂

  • http://elanandrafa.com themice

    Thank you! <3

  • http://www.lucasvallim.com Lucas

    It worked. Thanks!!!!!

  • http://about.me/dedmau5 dedmau5

    At a “stroaky-beard-meeting” at Apple: “How do we fuck as much as pos­si­ble with our cus­tomers?” “hmm” “yeah lets detach Git from xcode, that will affect like… fifty gazil­lion users!” “that’s bril­liant, Brian! Here, have a raise!”

    … sigh.
    thanks a bunch tho @Kavit

    • tuto­ri­al­hori­zon

      You’re wel­come @dedmau5:disqus .

  • http://duckonwater.com/ Dun­can Michael-MacGregor

    Worked a treat! thank you 🙂

  • https://www.theriovibe.com/ Dan Bond

    Cheers !

  • Le dieu hoa

    thanks sooooo much!!!!

  • Karl Pokus

    Thanks! God­damn it apple!

  • http://www.mrg-code.com Andres Ramos

    After updat­ing to macOS Sierra, I had the prob­lem run­ning git com­mand. It works now. Thank you!

    • Ash­wani Agarwal

      I’m count­ing on you, and doing the same with my upgrade

    • http://twitter.com/angelinfante Angel Infante

      Doing the same, thanks 🙂

    • http://shanmdphd.github.io/ Sung­pil Han

      I’m not the only one. After hav­ing macOS Sierra, the error occurred and this page helped me solv­ing the error.

      • Micheal Bue

        Same for me with Sierra, thanks

    • hanzhi­meng

      Same here.

    • Moham­mad Entezari

      Same here. Thank you.

    • tuto­ri­al­hori­zon

      You’re wel­come. I am over­whelmed with all your sweet comments !

  • Cris­t­ian Oană-Haidu

    thx man 🙂

  • Goofy­Dawg

    Not only does Sierra detach git, if you’re using an IDE like Intel­liJ, you’ll lose your JVM! As much as I didn’t like Steve Jobs, this would’ve been a qual­ity issue that he wouldn’t have let happen.

  • Vlad Shevtsov

    Thanks a lot! That helped me! (I’m using macOS Sierra)

  • http://www.brianhokke.nl jus­tas­tranger

    After mac OS Sierra update, git stopped work­ing. Thank you for this.

    Brack­ets threw an error:
    Error: git is not installed or not in the PATH

  • Nick

    Cheers, this worked!!!

  • Gus­tavo

    It works like a charm. Thank you so much!

  • Akash Sri­vas­tava

    The one line that brought back the day­lights knocked out of me by Apple !! Thanks a lot

  • David Fen­lon

    What a beau­ti­fully sim­ple res­o­lu­tion! Thank you!

  • http://www.dequn.github.io Dequn Zhang

    Work for me, also caused by macOS. Thank you!

  • tab­la­tronix

    Same prob­lem here with the plat­formio IDE I use, it uses python neti­faces and it was fail­ing to com­pile it. THANK YOU!

  • Phil

    in case this does *not* fix your prob­lem on macos sierra, you can try the following:

    1. find out where your instance of xcrun sits: ‘which xcrun‘
    2. type the fol­low­ing: ‘ln –s path/from/step_1 /Library/Developer/CommandLineTools/usr/bin/xcrun‘

    that should do it!

  • William Roger

    Thanks!

  • Gopal

    Thank you! After bang­ing my head to n num­bers of posts I have finally found this and this worked like magic. You are a sav­ior. Keep up the good work.

    Thank you again! 🙂

  • Peter­Ver­mont

    Thanks!

  • Craig R Morton

    Great, thanks for sharing.