Skip to content

Commit b0930fb

Browse files
authored
chore: update default nodejs version to 16 (#3107)
As of 2021-10-26, v16 has entered LTS, so it's the most appropriate default. Also, it provides darwin_arm releases (apple silicon) which many developers now expect. BREAKING CHANGE: The default nodejs version is now 16.12.0. To go back to the previous default, put this in your WORKSPACE: ```starlark load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") node_repositories( node_version = "14.17.5", ) ``` Fixes #3101
1 parent 5c3327e commit b0930fb

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

docs/Built-ins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Defaults to `["https://nodejs.org/dist/v{version}/{filename}"]`
166166

167167
(*String*): the specific version of NodeJS to install or, if vendored_node is specified, the vendored version of node
168168

169-
Defaults to `"14.17.5"`
169+
Defaults to `"16.12.0"`
170170

171171
<h4 id="node_repositories-package_json">package_json</h4>
172172

examples/parcel/WORKSPACE

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,29 @@ load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_depende
2929

3030
rules_nodejs_dependencies()
3131

32-
load("@build_bazel_rules_nodejs//:index.bzl", "npm_install")
32+
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install")
33+
34+
node_repositories(
35+
# with node 16, this example fails on circleCI, because
36+
# parcel has a gyp build on install that fails due to wrong
37+
# version of the python interpreter:
38+
# npm ERR! code 1
39+
# npm ERR! path /tmp/tmp-22804uFaivyUQN3f5/node_modules/deasync
40+
# npm ERR! command failed
41+
# npm ERR! command sh -c node ./build.js
42+
# npm ERR! gyp info it worked if it ends with ok
43+
# npm ERR! gyp info using node-gyp@8.2.0
44+
# npm ERR! gyp info using node@16.12.0 | linux | x64
45+
# npm ERR! gyp ERR! find Python
46+
# npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
47+
# npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
48+
# npm ERR! gyp ERR! find Python checking if "python3" can be used
49+
# npm ERR! gyp ERR! find Python - executable path is "/usr/bin/python3"
50+
# npm ERR! gyp ERR! find Python - version is "3.5.3"
51+
# npm ERR! gyp ERR! find Python - version is 3.5.3 - should be >=3.6.0
52+
# npm ERR! gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
53+
node_version = "14.17.5",
54+
)
3355

3456
npm_install(
3557
name = "npm",

nodejs/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load("//nodejs/private:yarn_versions.bzl", "YARN_VERSIONS")
88
load("//third_party/github.com/bazelbuild/bazel-skylib:lib/paths.bzl", "paths")
99
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1010

11-
DEFAULT_NODE_VERSION = "14.17.5"
11+
DEFAULT_NODE_VERSION = "16.12.0"
1212

1313
BUILT_IN_NODE_PLATFORMS = PLATFORMS.keys()
1414

0 commit comments

Comments
 (0)