async function resolvePackageVersion(info) {
	// use the locally installed/cached version if available
	const key = info.module + '@' + info.version;
	const cached = DIST_TAG_CACHE.get(key);
	if (cached) {
		if (Date.now() - cached.time <= DIST_TAG_TTL) {
			info.version = cached.version;
			return info;
		}
	}

	// If not specified, use any version constraints from the project's package.json:
	if (!info.version) {
		if (!appPackageJson) {
			appPackageJson = (await readPackageJson(resolve(NODE_MODULES, '..', 'package.json'))) || {};
		}
		const resolvedVersion =
			getPackageVersionFromDeps(appPackageJson, info.module) ||
			getPackageVersionFromResolutions(appPackageJson, info.module);
		info.version = resolvedVersion || 'latest';
	}

	const pkg = await readPackageJson(resolve(NODE_MODULES, info.module, 'package.json'));
	if (pkg) {
		DIST_TAG_CACHE.set(key, { time: Date.now(), version: pkg.version });
		info.version = pkg.version;
		return info;
	}

	const r = await manuallyResolvePackageVersion(info);
	DIST_TAG_CACHE.set(key, { time: Date.now(), version: r.version });
	return r;
}
Resolve a (possible) dist-tag version
@template {Module} T
@param {T} info