homebrew can't install node 0.10.24
Problem
Getting this error when installing node via Homebrew:
brew install node
==> Downloading http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
Already downloaded: /Library/Caches/Homebrew/node-0.10.24.tar.gz
==> Patching
patching file tools/gyp/pylib/gyp/xcode_emulation.py
==> ./configure --prefix=/usr/local/Cellar/node/0.10.24
env: python: No such file or directory
What's going on here?
python --version
returns Python 2.7.6
and which python
points to /usr/local/bin/python
.
Solution
It looks like the root problem was that your Apple-supplied Python was somehow broken—it was there enough for Homebrew to find it and set up the environment to use it, but not there enough to actually run—as in /usr/bin/python
doesn't exist, and therefore /usr/bin/env python
finds nothing when run in an environment without the Homebrew stuff added.
You really ought to figure out how you did that, and then fix it. That might require updating or repairing OS X. (I don't actually know how to do that anymore in 10.8 or 10.9, but that's a great question for SuperUser.) All kinds of other things can break if your Apple Python is broken, including everything from OS services to random bits deep inside some Homebrew port.
Creating a symlink from /usr/bin/python2.7
to /usr/bin/python
will sort of work, but it's really not right. /usr/bin/python
is a special stub executable that can be used (depending on global settings and environment-variable flags) to run any of the Python versions in /System/Library/Frameworks/Python.framework
(normally that's 2.7, 2.6, 2.5, and a partial 2.3), while /usr/bin/python2.7
is a stub executable that just runs the 2.7 version. You might get away with it, but I wouldn't unless you really have no choice.
Discussion
View additional discussion.