Skip to content

Commit b22914d

Browse files
authored
Upgrade to Node.js 14 (github#15822)
* set engines.node to >=12 * set engines.node to >=12 * Update node-versions.md * update Node.js version in Actions workflows * Update .node-version * Update references to Node.js version from 12 to 14 * Update Dockerfile to use Node.js 14 * set engines.node to safe "12 - 14" range
1 parent 6f5edb7 commit b22914d

9 files changed

+36
-54
lines changed

.github/workflows/sync-algolia-search-indices.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v2
1616
- uses: actions/setup-node@v1
1717
with:
18-
node-version: "12.x"
18+
node-version: 14.x
1919
- name: cache node modules
2020
uses: actions/cache@v1
2121
with:

.github/workflows/test-translations.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup node
2020
uses: actions/setup-node@v1
2121
with:
22-
node-version: 12.x
22+
node-version: 14.x
2323

2424
- name: Get npm cache directory
2525
id: npm-cache
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup node
5858
uses: actions/setup-node@v1
5959
with:
60-
node-version: 12.x
60+
node-version: 14.x
6161

6262
- name: Get npm cache directory
6363
id: npm-cache

.github/workflows/test-windows.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup node
2121
uses: actions/setup-node@v1
2222
with:
23-
node-version: 12.x
23+
node-version: 14.x
2424

2525
- name: Get npm cache directory
2626
id: npm-cache
@@ -58,7 +58,7 @@ jobs:
5858
- name: Setup node
5959
uses: actions/setup-node@v1
6060
with:
61-
node-version: 12.x
61+
node-version: 14.x
6262

6363
- name: Get npm cache directory
6464
id: npm-cache

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup node
2424
uses: actions/setup-node@v1
2525
with:
26-
node-version: 12.x
26+
node-version: 14.x
2727

2828
- name: Get npm cache directory
2929
id: npm-cache
@@ -60,7 +60,7 @@ jobs:
6060
- name: Setup node
6161
uses: actions/setup-node@v1
6262
with:
63-
node-version: 12.x
63+
node-version: 14.x
6464

6565
- name: Get npm cache directory
6666
id: npm-cache

.node-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.8.0
1+
14.13.0

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# INSTALLATION IMAGE
77
# A temporary image that installs production-only dependencies
88

9-
FROM node:12-alpine as installation
9+
FROM node:14-alpine as installation
1010
ENV NODE_ENV production
1111
WORKDIR /usr/src/docs
1212
COPY package*.json ./
@@ -18,7 +18,7 @@ RUN npm ci
1818
# BUNDLE IMAGE
1919
# A temporary image that installs dependencies and builds the production-ready front-end bundles.
2020

21-
FROM node:12-alpine as bundles
21+
FROM node:14-alpine as bundles
2222
WORKDIR /usr/src/docs
2323
# Install the files used to create the bundles
2424
COPY package*.json ./
@@ -32,7 +32,7 @@ RUN npm ci && npm run build
3232
# --------------------------------------------------------------------------------
3333
# MAIN IMAGE
3434

35-
FROM node:12-alpine
35+
FROM node:14-alpine
3636

3737
# Let's make our home
3838
WORKDIR /usr/src/docs

contributing/development.md

+2-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This site is powered by Node.js! :sparkles: :turtle: :rocket: :sparkles:
88

99
It runs on macOS, Windows, and Linux environments.
1010

11-
You'll need **Node.js v12** to run the site. If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) below for instructions on switching to Node.js 12. If you're not using `nodenv`, the best way to install Node.js is to [download the LTS installer from nodejs.org](https://nodejs.org).
11+
You'll need **Node.js v14** to run the site. If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) for instructions on switching Node.js versions. If you're not using `nodenv`, the best way to install Node.js is to [download the LTS installer from nodejs.org](https://nodejs.org).
1212

1313
Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following:
1414

@@ -52,26 +52,4 @@ For more info about working with this site, check out these READMEs:
5252
- [middleware/README.md](../middleware/README.md)
5353
- [script/README.md](../script/README.md)
5454
- [stylesheets/README.md](../stylesheets/README.md)
55-
- [tests/README.md](../tests/README.md)
56-
57-
## `nodenv`
58-
59-
[nodenv](https://github.com/nodenv/nodenv) is a tool for managing multiple Node.js versions on your local machine. It is **not required** to run this app, but you may already have it installed if you've worked on other projects that use Node.js.
60-
61-
To install Node.js 12 and make it your default version, run this command:
62-
63-
```sh
64-
nodenv install 12.8.0 && nodenv global 12.8.0
65-
```
66-
67-
You may sometimes see a warning when running npm scripts with nodenv:
68-
69-
```sh
70-
npm WARN lifecycle The node binary used for scripts is [...] but npm is using [...]
71-
```
72-
73-
This is due to nodenv's overriding behavior. To silence this harmless warning, the [nodenv docs](https://github.com/nodenv/nodenv/wiki/FAQ#npm-warning-about-mismatched-binaries) recommend running the following command from any directory:
74-
75-
```sh
76-
npm config set scripts-prepend-node-path auto
77-
```
55+
- [tests/README.md](../tests/README.md)

contributing/node-versions.md

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
## Node Versions
1+
# Node Versions
22

3-
The site currently runs on Node.js v12, the [Active LTS version](https://nodejs.org/en/about/releases/) that will be supported until 2020-10-20.
3+
The site currently runs on Node.js v14, the [Active LTS version](https://nodejs.org/en/about/releases/) from 2020-10-27 to 2021-10-26.
44

55
When updating to a new Node.js version, consider the following files:
66

7-
- The `engines.node` entry in `package.json`
8-
- The `.node-version` file used by [nodenv](https://github.com/nodenv/nodenv), a tool for managing multiple Node.js versions on your machine.
9-
- The `.github/*.workflow` Actions files
10-
- The `Dockerfile` that can be used for deployments
11-
- This README!
7+
- [ ] The `engines.node` entry in `package.json`
8+
- [ ] The `.node-version` file used by [nodenv](https://github.com/nodenv/nodenv), a tool for managing multiple Node.js versions on your machine.
9+
- [ ] The `.github/*.workflow` Actions files
10+
- [ ] The `Dockerfile` that can be used for deployments
11+
- [ ] The `contributing/development.md` guide
12+
- [ ] The `contributing/node-versions.md` file
1213

13-
### `nodenv`
14+
## `nodenv`
1415

15-
[nodenv](https://github.com/nodenv/nodenv) is a tool for managing multiple
16-
Node.js versions on your local machine. It is **not required** to run the
17-
docs-internal app, but you may already have it installed if you've worked on other
18-
internal GitHub projects that use Node.js.
16+
[nodenv](https://github.com/nodenv/nodenv) is a tool for managing multiple Node.js versions on your local machine. It is **not required** to run this app, but you may already have it installed if you've worked on other projects that use Node.js.
1917

20-
To install Node.js 12 and make it your default version, run this command:
18+
If you're using macOS, run this command to get the latest:
19+
20+
```
21+
brew upgrade nodenv node-build
22+
```
23+
24+
If you're using another operating system, or did not use Homebrew to install nodenv, see these [upgrade instructions](https://github.com/nodenv/nodenv#installation).
25+
26+
To install Node.js 14 and make it your default version, run this command:
2127

2228
```sh
23-
nodenv install 12.8.0 && nodenv global 12.8.0
29+
nodenv install 14.13.0 && nodenv global 14.13.0
2430
```
2531

2632
You may sometimes see a warning when running npm scripts with nodenv:
@@ -29,10 +35,8 @@ You may sometimes see a warning when running npm scripts with nodenv:
2935
npm WARN lifecycle The node binary used for scripts is [...] but npm is using [...]
3036
```
3137

32-
This is due to nodenv's overriding behavior. To silence this harmless warning,
33-
the [nodenv docs](https://github.com/nodenv/nodenv/wiki/FAQ#npm-warning-about-mismatched-binaries)
34-
recommend running the following command from any directory:
38+
This is due to nodenv's overriding behavior. To silence this harmless warning, the [nodenv docs](https://github.com/nodenv/nodenv/wiki/FAQ#npm-warning-about-mismatched-binaries) recommend running the following command from any directory:
3539

3640
```sh
3741
npm config set scripts-prepend-node-path auto
38-
```
42+
```

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"pa11y-test": "start-server-and-test browser-test-server 4001 pa11y-ci"
141141
},
142142
"engines": {
143-
"node": "8 - 12"
143+
"node": "12 - 14"
144144
},
145145
"repository": "https://github.com/github/docs",
146146
"standard": {

0 commit comments

Comments
 (0)