title: npm install mongoose fails (kerberos and bson errors)
body: <p>So I'm attempting to launch my node app, but there's a few errors arising from my MongoDB installation.</p>
  
  <p><em>Here are the specs for my dev environment:</em></p>
  
  <p><strong>node => 0.10.33</strong> (installed from nodejs.org)</p>
  
  <p><strong>npm => 1.4.28</strong> (installed from nodejs.org)</p>
  
  <p><strong>git => 2.1.3</strong> (homebrewed)</p>
  
  <p><strong>mongodb => 2.6.5</strong> (homebrewed)</p>
  
  <p>If it makes a difference, I am also using the <a href="https://github.com/vkarpov15/mean-stack-skeleton">Mean Stack Skeleton</a> as part of a tutorial.</p>
  
  <p>In a nutshell, when I try to run my node app using <code>$ node app.js</code>, I get the following feedback:</p>
  
  <pre><code>USER$ npm install mongoose
  
  &gt; kerberos@0.0.4 install /Users/USER/APP/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
  &gt; (node-gyp rebuild 2&gt; builderror.log) || (exit 0)
  
    CXX(target) Release/obj.target/kerberos/lib/kerberos.o
    CXX(target) Release/obj.target/kerberos/lib/worker.o
    CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
    CC(target) Release/obj.target/kerberos/lib/base64.o
    CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
    SOLINK_MODULE(target) Release/kerberos.node
    SOLINK_MODULE(target) Release/kerberos.node: Finished
  
  &gt; bson@0.2.15 install /Users/USER/APP/node_modules/mongoose/node_modules/mongodb/node_modules/bson
  &gt; (node-gyp rebuild 2&gt; builderror.log) || (exit 0)
  
    CXX(target) Release/obj.target/bson/ext/bson.o
    SOLINK_MODULE(target) Release/bson.node
    SOLINK_MODULE(target) Release/bson.node: Finished
  mongoose@3.8.18 node_modules/mongoose
  ├── regexp-clone@0.0.1
  ├── muri@0.3.1
  ├── sliced@0.0.5
  ├── hooks@0.2.1
  ├── mpath@0.1.1
  ├── mpromise@0.4.3
  ├── ms@0.1.0
  ├── mquery@0.8.0 (debug@0.7.4)
  └── mongodb@1.4.12 (readable-stream@1.0.33, kerberos@0.0.4, bson@0.2.15)
  </code></pre>
  
  <p>I checked the <code>builderror.log</code> files for both the <code>kerberos</code> and <code>bson</code> modules. However, both are empty.</p>
  
  <p>Some research I have found suggests that the issue might be because my <code>node-gyp</code> installation does not have a corresponding <code>binding.gyp</code> file.</p>
  
  <p>Also tried running <code>$ node-gyp configure</code> inside my Node.js project folder. And this is the error I received:</p>
  
  <pre><code>gyp: binding.gyp not found (cwd: /Users/USER/APP) while trying to load binding.gyp
  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/node-gyp/lib/configure.js:343:16)
  gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
  gyp ERR! System Darwin 12.5.0
  gyp ERR! command "node" "/usr/local/bin/node-gyp" "configure"
  gyp ERR! cwd /Users/USER/APP
  gyp ERR! node -v v0.10.33
  gyp ERR! node-gyp -v v1.0.2
  gyp ERR! not ok
  </code></pre>
  
  <p>Any ideas why I am having these issues?</p>
  
  <p>EDIT: After setting the port in my <code>app.js</code> file to set the port to the same one that the Express server is listening on (duh), I get more feedback indicating that I was using Mongoose 3.9.4, which is the latest unstable release of <code>mongoose</code>. So I set the module to 3.8.18 in my <code>package.json</code> and attempted to reinstall the module. I received the same errors. However, the unstable release feedback is gone now.</p>