lib/install.js
function cb (err) {
    if (cb.done) return
    cb.done = true
    if (err) {
      log.warn('install', 'got an error, rolling back install')
      // roll-back the install if anything went wrong
      gyp.commands.remove([ release.versionDir ], function () {
        callback(err)
      })
    } else {
      callback(null, release.version)
    }
  }
function cb (err) {
    if (cb.done) return
    cb.done = true
    if (err) {
      log.warn('install', 'got an error, rolling back install')
      // roll-back the install if anything went wrong
      gyp.commands.remove([ release.versionDir ], function () {
        callback(err)
      })
    } else {
      callback(null, release.version)
    }
  }
function cb ( err ) { if ( cb . done ) return cb . done = true if ( err ) { log . warn ( 'install' , 'got an error, rolling back install' ) // roll-back the install if anything went wrong gyp . commands . remove ( [ release . versionDir ] , function ( ) { callback ( err ) } ) } else { callback ( null , release . version ) } }
ensure no double-callbacks happen
ensure no double - callbacks happen