async defaultGetVersions(name, cwd) {
    const { execFile, parseJson, console } = this.caps
    const { newPkg } = this.opts

    /** @type {string | undefined} */
    let versionContents
    try {
      versionContents = await execFile(
        'npm',
        ['view', name, 'versions', '--json'],
        {
          cwd,
        }
      ).then(({ stdout }) => stdout.trim())
    } catch (e) {
      if (/** @type {NodeJS.ErrnoException} */ (e).code === 'ENOENT') {
        throw new Error(`Could not find npm: ${e}`)
      }
      if (newPkg.includes(name)) {
        console.error(
          `${INFO} Package ${Laverna.pkgToString(name)} confirmed as new`
        )
      } else {
        // it doesn't appear that the type of a rejection from a
        // promisify'd `exec` is surfaced in the node typings
        // anywhere.
        const err = /**
         * @type {import('node:child_process').ExecFileException & {
         *   stdout: string
         * }}
         */ (e)

        // when called with `--json`, you get a JSON error.
        // this could also be handled in a catch() chained to the `exec` promise
        if ('stdout' in err) {
          /**
           * @type {{
           *   error: {
           *     code: string
           *     summary: string
           *     detail: string
           *   }
           * }}
           * @todo See if this type is defined anywhere in npm
           */
          const errJson = parseJson(err.stdout)

          throw new Error(
            `Querying for package ${Laverna.pkgToString(
              name
            )} failed (${errJson.error.summary.trim()}). Missing --newPkg=${name}?`
          )
        }
        throw err
      }
    }

    if (versionContents !== undefined) {
      /** @type {unknown} */
      let json
      try {
        json = parseJson(versionContents)
      } catch (err) {
        console.error(
          `${ERR} Failed to parse output from \`npm view\` for ${Laverna.pkgToString(
            name
          )} as JSON: ${versionContents}`
        )
        throw err
      }

      if (typeof json === 'string') {
        json = [json]
      }
      if (!isStringArray(json)) {
        throw new TypeError(
          `Output from \`npm view\` for ${Laverna.pkgToString(
            name
          )} was not a JSON array of strings: ${versionContents}`
        )
      }

      return json
    }
    return []
  }
Default implementation of a {@link GetVersions} function.

@type {import('./types').GetVersions}