Skip to content
Permalink
Browse files

fix(bazel): builder workspace should use nodejs v10.16.0 (#31088)

The generated Bazel workspace by the `@angular/bazel` builder should
use the latest stable NodeJS version. This is necessary because some
packages like `selenium-webdriver` which are part of the default bazel
setup in order to support `ng e2e` depend on a minimum NodeJS version
of `10.15.0`.. This means that running e2e tests in a plain new bazel CLI
project (`ng new {projectName} --collection=@angular/bazel`) errors.

```
command.
 (error selenium-webdriver@4.0.0-alpha.3: The engine "node" is incompatible with
 this module. Expected version ">= 10.15.0". Got "10.13.0"
error Found incompatible module
)
```

PR Close #31088
  • Loading branch information...
devversion authored and AndrewKushnir committed Jun 17, 2019
1 parent e0969b2 commit a1fc4deff38e8a78e505e81a37194966360bfa05
Showing with 15 additions and 1 deletion.
  1. +15 −1 packages/bazel/src/builders/files/WORKSPACE.template
@@ -39,7 +39,8 @@ http_archive(
####################################
# Load and install our dependencies downloaded above.

load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "yarn_install")
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories",
"yarn_install")
check_bazel_version(
message = """
You no longer need to install Bazel on your machine.
@@ -50,6 +51,19 @@ Try running `yarn bazel` instead.
""",
minimum_bazel_version = "0.26.0",
)

# Setup the Node repositories. We need a NodeJS version that is more recent than v10.15.0
# because "selenium-webdriver" which is required for "ng e2e" cannot be installed.
# TODO: remove the custom repositories once "rules_nodejs" supports v10.16.0 by default.
node_repositories(
node_repositories = {
"10.16.0-darwin_amd64": ("node-v10.16.0-darwin-x64.tar.gz", "node-v10.16.0-darwin-x64", "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c"),
"10.16.0-linux_amd64": ("node-v10.16.0-linux-x64.tar.xz", "node-v10.16.0-linux-x64", "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48"),
"10.16.0-windows_amd64": ("node-v10.16.0-win-x64.zip", "node-v10.16.0-win-x64", "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059"),
},
node_version = "10.16.0",
)

yarn_install(
name = "npm",
data = ["//:angular-metadata.tsconfig.json"],

0 comments on commit a1fc4de

Please sign in to comment.
You can’t perform that action at this time.