fix: validate node_version[_from_nvmrc] consistently (#3888)

Close #3887

## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)


## PR Type

What kind of change does this PR introduce?

- [x] Bugfix
- [ ] Feature (please, look at the "Scope of the project" section in the
README.md file)
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:


## What is the current behavior?

When using `node_version_from_nvmrc` validation is not performed and the
download macro exits early without error and without
downloading+extracting node.

Issue Number: #3887


## What is the new behavior?

The `node_version` and `node_version_from_nvmrc` validation is aligned
and fail the same.

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

---------

Co-authored-by: Alan Agius <alan.agius4@gmail.com>
5 files changed
tree: abffaae9dff38ec0263a12e8174d638641e8aab6
  1. .aspect/
  2. .bazelci/
  3. .bcr/
  4. .github/
  5. .vscode/
  6. docs/
  7. e2e/
  8. external/
  9. internal/
  10. nodejs/
  11. packages/
  12. scripts/
  13. tools/
  14. .bazelignore
  15. .bazelrc
  16. .bazelversion
  17. .clang-format
  18. .git-blame-ignore-revs
  19. .gitignore
  20. .npmrc
  21. .pre-commit-config.yaml
  22. .prettierignore
  23. AUTHORS
  24. BUILD.bazel
  25. CHANGELOG.md
  26. CODE_OF_CONDUCT.md
  27. commitlint.config.js
  28. CONTRIBUTING.md
  29. CONTRIBUTORS
  30. DEVELOPING.md
  31. LICENSE
  32. MODULE.bazel
  33. package.json
  34. pnpm-lock.yaml
  35. README.md
  36. renovate.json
  37. repositories.bzl
  38. WORKSPACE
README.md

JavaScript rules for Bazel

Build status GitHub release (latest by date)

This ruleset provides a Node.js development toolchain and runtime with Bazel. It does not have any rules for using Node.js, such as nodejs_binary. For that, we recommend rules_js.

This repository is maintained by volunteers in the Bazel community. Neither Google, nor the Bazel team, provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases.

We follow semantic versioning. Patch releases have bugfixes, minor releases have new features. Only major releases (1.x, 2.x) have breaking changes. We support LTS releases of Bazel (starting at 4.x), see SUPPORTED_BAZEL_VERSIONS in our /index.bzl for the list we test against.

6.0 Scope Reduction

This branch is the latest release, 6.x.x It has a greatly reduced scope from previous releases, as most of the code was unmaintained. See the 5.x branch for the prior state of the repo.

Documentation

See the docs/ folder, and generated API docs on https://registry.bazel.build/docs/rules_nodejs