docs: function getInstalledPath (name, opts) {
    return new Promise((resolve, reject) => {
      if (!isValidString(name)) {
        const message = 'get-installed-path: expect `name` to be string'
        return reject(new TypeError(message))
      }
  
      const targetPaths = defaults(name, opts)
      const statPath = (filepath) =>
        fs.stat(filepath, (e, stats) => {
          if (e && targetPaths.length > 0) {
            statPath(targetPaths.shift())
            return
          } else if (e) {
            const label = 'get-installed-path:'
            const msg = `${label} module not found "${name}" in path ${filepath}`
            return reject(new Error(msg))
          }
  
          if (stats.isDirectory()) {
            return resolve(filepath)
          }
  
          const msg = `Possibly "${name}" is not a directory: ${filepath}`
          let err = new Error('get-installed-path: some error occured! ' + msg)
          reject(err)
        })
      statPath(targetPaths.shift())
    })
  }