npmのパッケージインストール時にnode-gypがエラーを出すなら、
コンパイル時につかうPython系の不整合が問題であるケースが考えられます。
その際は"pyenv local"などでpythonを2.7系におとすと上手くいったりします。
実際のところ
$ npm install npm WARN package.json passport-test@0.0.1 No description npm WARN package.json passport-test@0.0.1 No repository field. npm WARN package.json passport-test@0.0.1 No README data > kerberos@0.0.12 install /Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos > (node-gyp rebuild 2> builderror.log) || (exit 0) | > bson-ext@0.1.8 install /Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext > (node-pre-gyp install --fallback-to-build) || (node-gyp rebuild 2> builderror.log) || (exit 0) gyp ERR! configure error gyp ERR! stack Error: Python executable "python" is v3.4.3, which is not supported by gyp. gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0. gyp ERR! stack at failPythonVersion (/Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:108:14) gyp ERR! stack at /Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:97:9 gyp ERR! stack at ChildProcess.exithandler (child_process.js:735:7) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at maybeClose (child_process.js:1008:16) gyp ERR! stack at Socket.<anonymous> (child_process.js:1176:11) gyp ERR! stack at Socket.emit (events.js:107:17) gyp ERR! stack at Pipe.close (net.js:476:12) gyp ERR! System Darwin 14.1.0 gyp ERR! command "/Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/bin/node" "/Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build/Release/bson.node" "--module_name=bson" "--module_path=/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build/Release" gyp ERR! cwd /Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext gyp ERR! node -v v0.12.0 gyp ERR! node-gyp -v v1.0.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/bin/node /Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build/Release/bson.node --module_name=bson --module_path=/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build/Release' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17) node-pre-gyp ERR! stack at maybeClose (child_process.js:1008:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5) node-pre-gyp ERR! System Darwin 14.1.0 node-pre-gyp ERR! command "node" "/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext node-pre-gyp ERR! node -v v0.12.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.4 node-pre-gyp ERR! not ok Failed to execute '/Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/bin/node /Users/shuzo_kino/.anyenv/envs/ndenv/versions/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build/Release/bson.node --module_name=bson --module_path=/Users/shuzo_kino/node/passport/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build/Release' (1)
pythonのバージョンを落とせとか書いてますね(怒り
ここでいうnode-gyp
GitHub - nodejs/node-gyp: Node.js native addon build tool
とは、C++のコードをバイナリ化する際に必要とされるやつでパッケージによっては必須です。