Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown NodeJS version-host %s" % version_host_os #3065

Closed
PengKuang opened this issue Nov 5, 2021 · 2 comments
Closed

Unknown NodeJS version-host %s" % version_host_os #3065

PengKuang opened this issue Nov 5, 2021 · 2 comments

Comments

@PengKuang
Copy link

PengKuang commented Nov 5, 2021

🐞 bug report

Affected Rule

nodejs The issue is caused by the rule: nodejs

Is this a regression?

don't know Yes, the previous version in which this bug was not present was: ....

Description

A clear and concise description of the problem...

error when use bazel to build gerrit on macos big sur M1

🔬 Minimal Reproduction

run bazel build gerrit or bazel build gerrit --host_javabase=@local_jdk//:jdk in the gerrit directory on the cmd
the gerrit version is v3.4.0

🔥 Exception or Error



ERROR: While resolving toolchains for target @npm//@bazel/rollup/bin:rollup-worker: no matching toolchains found for types @build_bazel_rules_nodejs//toolchains/node:toolchain_type


:INFO: Build option --define has changed, discarding analysis cache.
INFO: Repository nodejs_darwin_amd64 instantiated at:
  /Users/pengkuang/gerrit/WORKSPACE:76:18: in 
  /private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl:776:15: in node_repositories
  /private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl:796:18: in _maybe
Repository rule node_repositories_rule defined at:
  /private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl:715:41: in 
ERROR: An error occurred during the fetch of repository 'nodejs_darwin_amd64':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl", line 709, column 19, in _nodejs_repo_impl
		_download_node(repository_ctx)
	File "/private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl", line 290, column 13, in _download_node
		fail("Unknown NodeJS version-host %s" % version_host_os)
Error in fail: Unknown NodeJS version-host 17.0.0-darwin_amd64
ERROR: Error fetching repository: Traceback (most recent call last):
	File "/private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl", line 709, column 19, in _nodejs_repo_impl
		_download_node(repository_ctx)
	File "/private/var/tmp/_bazel_pengkuang/42c7e433c8424387404b45dd43df7500/external/build_bazel_rules_nodejs/internal/node/node_repositories.bzl", line 290, column 13, in _download_node
		fail("Unknown NodeJS version-host %s" % version_host_os)
Error in fail: Unknown NodeJS version-host 17.0.0-darwin_amd64
ERROR: /Users/pengkuang/gerrit/BUILD:35:8: error loading package 'polygerrit-ui/app': Encountered error while reading extension file '@bazel/typescript/index.bzl': no such package '@npm//@bazel/typescript': no such package '@nodejs_darwin_amd64//': Unknown NodeJS version-host 17.0.0-darwin_amd64 and referenced by '//:gerrit'
ERROR: Analysis of target '//:gerrit' failed; build aborted: Analysis failed
INFO: Elapsed time: 0,096s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 5 targets conf\
igured)

🌍 Your Environment

Operating System:

  
macos Big Sur v11.5.2
  

Output of bazel version:

  
Build label: 4.2.1-homebrew
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800
  

Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
3.8.0
or 3.3.2
or 4.4.3
neither of them works, don't know how to check `@bazel/*` npm packages; 
but I tried to download both nodejs v17 and v15
  

Anything else relevant?
followed this thread (#2733) to resolve the prior error, which leads to the new error

@alexeagle
Copy link
Collaborator

We don't have node 17 in https://github.com/bazelbuild/rules_nodejs/blob/stable/nodejs/private/node_versions.bzl

#2992 currently prevents using a custom node version as well :(

@mattem
Copy link
Collaborator

mattem commented Feb 26, 2022

17.x has since been added, and custom node versions resolved in #3339

@mattem mattem closed this as completed Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants