You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiler: Apple LLVM version 10.0.0 (clang-1000.10.25.5)
Module:
Verbose output (from npm or node-gyp):
> node-gyp rebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Some strange behavior: When I use the npm script to run the node-gyp would rebuild failed, but ./node_modules/node-gyp/bin/node-gyp.js will run ok.
xcode_emulation.py
in XcodeVersion version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
Verbose output
Traceback (most recent call last):
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
sys.exit(gyp.script_main())
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
return main(sys.argv[1:])
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
return gyp_main(args)
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput
part_of_all=qualified_target in needed_targets)
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write
self.Pchify))
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSources
cflags = self.xcode_settings.GetCflags(configname)
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflags
archs = self.GetActiveArchs(self.configname)
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs
xcode_archs_default = GetXcodeArchsDefault()
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
xcode_version, _ = XcodeVersion()
File "/Users/dennis/.nvm/versions/node/v10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion
version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
Reacted by Illia Lukianov, pperk and Seyed Mostafa Meshkati
I simply changed it from 3.3 to 3.7 and my npm install was able to complete successfully.
Reacted by rtsmith, Jakub Zawiślak, Emmanuel Odongo, Wouter Ligtenberg, Can Agirkaya, djarrin, Jesse McClure, Soheil, Joshua Davis, Baris Wanschers and 4 more
Reacted by ll14m4n
Reacted by ll14m4n, Karel Ledru, Illia Lukianov and zemunkh
I don't have XCode installed, but I do have the Command Line Tools installed. It seems like node-gyp is having an issue determining something about the XCode environment (xcode_emulation.py).
I'm having the same issue with macOS version: High Sierra, 10.13.6, Node v11.0.0 when running npm rebuild node-sass. Let me know if you've managed to fix it somehow.
It looks like yesterday Apple released some updates to High Sierra and Command Line Tools... going to try them now and post back if it's still happening.
Yesterday I was also trying with only Command Line Tools installed, now I've installed full XCode, so that will also be impacting my 2nd attempt.
@aguynamedben are you running it from an IDE terminal by any chance? it seems to work for me now if I run it from iTerm, not sure what bins RubyMine was using.
What is the output of xcodebuild -version?
For me it is:
$ xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Running sudo xcode-select --switch /Library/Developer/CommandLineTools fixed it for me
Reacted by mariajosesanchez, Vipinunnikrishnan, Dani Acosta, Jerry Sumpton, Mojtaba, Georgios Giannoutsos Barkas, Andrew Simpson, Tino Kreutzer, Kames Geraghty, Sebastian and 1 more
This was the only way I was able to solve this. manually setting this in Xcode settings:
Reacted by Andrew Walker, varunmukka-okta, Sven, Hello Frances, Miguel Parramón Teixidó, Park Hee Chan, Ben Drozdoff, Enrique Delgado, Ramesh, themyth92 and 22 more
Reacted by Philip Cunningham, Robin Engers and Emanuel Alejandro Lujan Aldaba
Reacted by Philip Cunningham, Robin Engers, Emanuel Alejandro Lujan Aldaba and Ikraam Ghoor
After trying most of the above, what ended up working for me was, believe it or not, simply updating node to the latest version.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Depending on the dependencies of your particular project, you may not be able to use the latest stable version of node, but you can try upgrading to the latest version your project allows and see if it resolves the issue as it did for me.
Reacted by Gábor Sebestyén, Berker Peksag, Leo Barcellos, Rohit Aneja, Bin Liang, Christian Clauss and Luis Lopes
After trying most of the above, what ended up working for me was, believe it or not, simply updating node to the latest version.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Depending on the dependencies of your particular project, you may not be able to use the latest stable version of node, but you can try upgrading to the latest version your project allows and see if it resolves the issue as it did for me.
Activity
bnoordhuis commentedon Jun 12, 2018
You can ignore that xcode-select error; if you upgrade node-gyp, you won't even see it. What's the actual build error?
realdennis commentedon Jun 12, 2018
xcode_emulation.py
in XcodeVersion
version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]AttributeError: 'NoneType' object has no attribute 'groups'
Verbose output
richardlau commentedon Jun 12, 2018
This is #1454 fixed by #1455.
bnoordhuis commentedon Jun 13, 2018
Yep, if you upgrade to 3.6.3 or 3.7.0 things should work. I'll go ahead and close this out but let me know if you still have issues after upgrading.
agm1984 commentedon Oct 12, 2018
I just had this problem. After some diagnosis, I was able to just update the version for node-gyp inside the
package-lock.json.I've never had to edit the file directly before, but mine was throwing the exact same error as the one posted here by realdennis.
Mine was
node-sassfailing and it was depending on node-gyp v3.3.Here is the code inside my package-lock.json for reference and context:
I simply changed it from 3.3 to 3.7 and my
npm installwas able to complete successfully.aguynamedben commentedon Oct 30, 2018
I'm seeing this with:
I don't have XCode installed, but I do have the Command Line Tools installed. It seems like node-gyp is having an issue determining something about the XCode environment (xcode_emulation.py).
I'm installing XCode and will try after that.
Any ideas?
binding.gyp: https://github.com/proxy/gist.github.com/aguynamedben/f46b059e5551afebd964da130614d78c
Command that is failing:
Error:
macOS version: High Sierra, 10.13.6
csergiu commentedon Oct 31, 2018
@aguynamedben
I'm having the same issue with macOS version: High Sierra, 10.13.6, Node v11.0.0 when running
npm rebuild node-sass. Let me know if you've managed to fix it somehow.aguynamedben commentedon Oct 31, 2018
@csergiu Can't figure it out. Have been trying various things for 1.5 days now.
@richardlau @bnoordhuis Any ideas? Should this be reopened?
aguynamedben commentedon Oct 31, 2018
It looks like yesterday Apple released some updates to High Sierra and Command Line Tools... going to try them now and post back if it's still happening.
Yesterday I was also trying with only Command Line Tools installed, now I've installed full XCode, so that will also be impacting my 2nd attempt.
richardlau commentedon Oct 31, 2018
What is the output of
xcodebuild -version?csergiu commentedon Oct 31, 2018
@aguynamedben are you running it from an IDE terminal by any chance? it seems to work for me now if I run it from iTerm, not sure what bins RubyMine was using.
spjsschl commentedon Oct 31, 2018
spjsschl commentedon Oct 31, 2018
Running
sudo xcode-select --switch /Library/Developer/CommandLineToolsfixed it for merichardlau commentedon Nov 1, 2018
Maybe refack/GYP3#1 would address this, or at least provide a more meaningful error message.
13 remaining items
AdamBD commentedon Apr 21, 2019
This was the only way I was able to solve this. manually setting this in Xcode settings:
eswardhinak commentedon Jul 11, 2019
@alexanmtz that link solved it for me! Thanks :)
Muzzera commentedon Aug 20, 2019
changed my node-sass for the last version and Voi la
w3debugger commentedon Oct 30, 2019
I faced this when I updated my macOS to Catalina. It is fixed 🎉
yarn.lock/package-lock.jsonfilesyarncclauss commentedon Oct 30, 2019
For those upgrading to macOS Catalina, please checkout #1940
Upgrade node-sass
bvenkatr commentedon Nov 14, 2019
Downgrading from Python3.xx to Python2.xx fixed the issue
pedro-machado-tala commentedon Dec 21, 2019
This works for me
npm install -g n
n 8.8.1
sudo npm explore npm -g -- npm install node-gyp@latest
bmfay commentedon Apr 8, 2020
After trying most of the above, what ended up working for me was, believe it or not, simply updating node to the latest version.
Depending on the dependencies of your particular project, you may not be able to use the latest stable version of node, but you can try upgrading to the latest version your project allows and see if it resolves the issue as it did for me.
segabor commentedon Apr 28, 2020
@bmfay your solution worked out. Saved my day, thanks!
rahianeja commentedon Dec 10, 2021
This worked for me
mboutin-qohash commentedon Feb 10, 2022
@Vipinunnikrishnan after 2h searching for answers, yours worked for me! Ty
sameerasood commentedon Apr 27, 2025
For anyone who stumbles here, faced a same issue after update mac OS to Sequio 15.4
I delete and installed X code command line tools
sudo rm -rf /Library/Developer/CommandLineToolssoftwareupdate --install "Command Line Tools for Xcode-16.2"needed version 16.2