Update to node v14.18.0 (#3026)

* Update to node v14.18.0
This commit is contained in:
Matt Godbolt
2021-10-11 23:18:19 -05:00
committed by GitHub
parent a8a11e37a9
commit dc1592cdc1
7 changed files with 41 additions and 42 deletions

View File

@@ -10,10 +10,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x
- name: Get npm cache directory
id: npm-cache
run: |
@@ -42,10 +42,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x
- name: TEST
run: |
which npx

View File

@@ -10,10 +10,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x
- name: Get npm cache directory
id: npm-cache
run: |

View File

@@ -20,10 +20,10 @@ If there is something you would like to do yourself, it might help to make an is
## Node version
**Compiler Explorer** currently targets [Node.js](https://nodejs.org/) LTS version 12.18,
**Compiler Explorer** currently targets [Node.js](https://nodejs.org/) LTS version 14.18.0,
so it's better if you do so as well when testing your changes locally.
Nonetheless, it _should_ run in everything post-Node.js 12.18. [Contact us] if
Nonetheless, it _should_ run in everything post-Node.js 14.18. [Contact us] if
this is not the case for you.
## In brief

View File

@@ -53,7 +53,7 @@ Assuming you have a compatible version of `node` installed, on Linux simply runn
on your local machine: [http://localhost:10240/](http://localhost:10240/). If this doesn't work for you, please contact
us, as we consider it important you can quickly and easily get running.
Currently, **Compiler Explorer**
requires [at least `node` 12 _(LTS version)_](CONTRIBUTING.md#node-version) installed, either on the path or at `NODE_DIR`
requires [at least `node` 14 _(LTS version)_](CONTRIBUTING.md#node-version) installed, either on the path or at `NODE_DIR`
(an environment variable or `make` parameter).
Running with `make EXTRA_ARGS='--language LANG'` will allow you to load

View File

@@ -4,43 +4,43 @@ set -e
OUT="$1"
find_node() {
local NODE="${NODE_DIR}/bin/node"
local CE_NODE="/opt/compiler-explorer/node/bin/node"
local SYS_NODE="$(which node 2>/dev/null)"
local SYS_NODEJS="$(which nodejs 2>/dev/null)"
NODE="${NODE_DIR}/bin/node"
CE_NODE="/opt/compiler-explorer/node/bin/node"
SYS_NODE="$(which node 2>/dev/null || true)"
SYS_NODEJS="$(which nodejs 2>/dev/null || true)"
if test -x "${NODE}" -a -n "${NODE_DIR}"; then
echo "${NODE}"
elif test -x "${CE_NODE}"; then
echo "${CE_NODE}"
elif test -x "${SYS_NODE}"; then
echo "${SYS_NODE}"
elif test -x "${SYS_NODEJS}"; then
echo "${SYS_NODEJS}"
else
>&2 echo "Unable to find a node"
fi
if test -x "${NODE}" -a -n "${NODE_DIR}"; then
echo "${NODE}"
elif test -x "${CE_NODE}"; then
echo "${CE_NODE}"
elif test -x "${SYS_NODE}"; then
echo "${SYS_NODE}"
elif test -x "${SYS_NODEJS}"; then
echo "${SYS_NODEJS}"
else
echo >&2 "Unable to find a node"
fi
}
NODE=$(find_node)
NODE="$(find_node)"
NODE_MIN_VERSION=12
NODE_VERSION_USED=12
NODE_MIN_VERSION=14
NODE_VERSION_USED=14
NODE_VERSION=$(${NODE} --version)
NODE_MAJOR_VERSION=$(echo ${NODE_VERSION} | cut -f1 -d. | sed 's/^v//g')
NODE_MAJOR_VERSION=$(echo "${NODE_VERSION}" | cut -f1 -d. | sed 's/^v//g')
if test ${NODE_MAJOR_VERSION} -lt ${NODE_MIN_VERSION}; then
>&2 echo Compiler Explorer is known not to run with versions prior to v${NODE_MIN_VERSION}
>&2 echo Visit https://nodejs.org/ for installation instructions for newer versions
>&2 echo To configure where we look for node, set NODE_DIR to its installation base
exit 1
if test "${NODE_MAJOR_VERSION}" -lt ${NODE_MIN_VERSION}; then
echo >&2 "Compiler Explorer is known not to run with versions prior to v${NODE_MIN_VERSION}"
echo >&2 "Visit https://nodejs.org/ for installation instructions for newer versions"
echo >&2 "To configure where we look for node, set NODE_DIR to its installation base"
exit 1
fi
if test ${NODE_VERSION_USED} -ne ${NODE_MAJOR_VERSION}; then
>&2 echo Warning: Compiler Explorer is only tested against v${NODE_VERSION_USED}.x, but v${NODE_MAJOR_VERSION} was found.
>&2 echo Note that you might find issues if you decide to keep this version
>&2 echo Visit https://nodejs.org/ for installation instructions for the required version
>&2 echo To configure where we look for node, set NODE_DIR to its installation base
if test ${NODE_VERSION_USED} -ne "${NODE_MAJOR_VERSION}"; then
echo >&2 "Warning: Compiler Explorer is only tested against v${NODE_VERSION_USED}.x, but v${NODE_MAJOR_VERSION} was found."
echo >&2 "Note that you might find issues if you decide to keep this version"
echo >&2 "Visit https://nodejs.org/ for installation instructions for the required version"
echo >&2 "To configure where we look for node, set NODE_DIR to its installation base"
fi
echo ${NODE} > ${OUT}
echo "${NODE}" >"${OUT}"

3
package-lock.json generated
View File

@@ -3685,8 +3685,7 @@
},
"color-string": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz",
"integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==",
"resolved": "",
"requires": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"

View File

@@ -12,7 +12,7 @@
},
"version": "0.0.3",
"engines": {
"node": ">=12.18"
"node": ">=14.18"
},
"main": "./app.js",
"esm": true,