async def METHOD_NAME(
    _: KnownPackageJsonUserResolveNamesRequest,
    all_projects: AllNodeJSProjects,
    user_chosen_resolves: UserChosenNodeJSResolveAliases,
) -> KnownUserResolveNames:
    names = FrozenOrderedSet(
        user_chosen_resolves.get(
            os.path.join(project.root_dir, project.lockfile_name), project.default_resolve_name
        )
        for project in all_projects
    )
    unmatched_aliases = set(user_chosen_resolves.values()).difference(names)
    if unmatched_aliases:
        projects = pluralize(len(unmatched_aliases), "project", include_count=False)
        lockfiles = ", ".join(
            lockfile
            for lockfile, alias in user_chosen_resolves.items()
            if alias in unmatched_aliases
        )
        paths = pluralize(len(unmatched_aliases), "path", include_count=False)
        raise ValueError(
            softwrap(
                f"""
                No nodejs {projects} could be found for {lockfiles}, but
                some are configured under [nodejs].resolves.
                Ensure that a package.json file you intend to manage with pants has
                a corresponding BUILD file containing a `{PackageJsonTarget.alias}` target
                by running `{bin_name()} {TailorGoal.name} ::`.
                Also confirm that {lockfiles} would be generated by your
                chosen nodejs package manager at the specified {paths}.
                """
            )
        )
    return KnownUserResolveNames(
        names=tuple(names),
        option_name="[nodejs].resolves",
        requested_resolve_names_cls=RequestedPackageJsonUserResolveNames,
    )