I'm in the process of building a web service that will eventually serve a mobile app I plan on writing. I'm building the service on Heroku using Node.js.
I will be posting lessons learned, observations made, and possibly some tutorials as I work my way through the process of building this service and learning a new development stack. Hopefully these posts will be of some use to somebody.
I was in the process of installing the PostgreSQL module pg for use with Heroku. My main development machines are currently OS X. In the process of installing the module I got a bunch of errors related to node-gyp.js
gyp ERR! build error gyp ERR! stack Error: not found: make gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16 gyp ERR! stack at Object.oncomplete (fs.js:297:15) gyp ERR! System Darwin 12.2.1 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /someDirectory/SomeWhere/node_modules/pg gyp ERR! node -v v0.8.19 gyp ERR! node-gyp -v v0.8.4 gyp ERR! not ok
In the end it turns out I did not have the Apple command line developer tools installed. This might sound like a simple mistake, and it is, but since Xcode has moved to a single application bundle it's pretty easy to forget that the common developer tools aren't readily available to the wider system.
To resolve this issue launch Xcode, then select Preferences -> Downloads -> Components and install the Command Line Tools package.
I realize this might seem like an obvious solution but I'm guessing I'm not the last person that will run into this issue.