if (process.platform === 'darwin') {
  var spawn = require('child_process').spawn;
  var args = ['install', '--fallback-to-build'];
  var options = {stdio: 'inherit'};
  var child = spawn('node-pre-gyp', args, options);
  child.on('close', process.exit);
}
if (process.platform === 'darwin') {
  var spawn = require('child_process').spawn;
  var args = ['install', '--fallback-to-build'];
  var options = {stdio: 'inherit'};
  var child = spawn(require.resolve('node-pre-gyp/bin/node-pre-gyp'), args, options);
  child.on('close', process.exit);
}

Use require.resolve to resolve node-pre-gyp.
Use require.resolve to resolve node-pre-gyp.
