Skip to content

chore: update node to v14 #3481

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

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Install helm
uses: azure/[email protected]
Expand Down Expand Up @@ -67,10 +67,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Fetch dependencies from cache
id: cache-yarn
Expand All @@ -96,10 +96,10 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Fetch dependencies from cache
id: cache-yarn
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Install development tools
run: |
Expand Down Expand Up @@ -244,10 +244,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Install nfpm
run: |
Expand All @@ -270,8 +270,8 @@ jobs:

- name: Replace node with arm64 equivalent
run: |
wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-arm64.tar.gz
tar -xzf node-v12.18.4-linux-arm64.tar.gz node-v12.18.4-linux-arm64/bin/node --strip-components=2
wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-arm64.tar.xz
tar -xf node-v14.17.0-linux-arm64.tar.xz node-v14.17.0-linux-arm64/bin/node --strip-components=2
mv ./node ./release-standalone/lib/node

- name: Build packages with nfpm
Expand All @@ -290,10 +290,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Install nfpm
run: |
Expand Down Expand Up @@ -333,10 +333,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install Node.js v12
- name: Install Node.js v14
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"

- name: Install playwright
uses: microsoft/playwright-github-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .tours/start-development.tour
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"file": "package.json",
"line": 31,
"description": "## Commands\n\nTo start developing, make sure you have Node 12+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
"description": "## Commands\n\nTo start developing, make sure you have Node 14+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
},
{
"file": "src/node/app.ts",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ VS Code v0.00.0
### Development

- chore: cross-compile docker images with buildx #3166 @oxy
- chore: update node to v14 #3458 @oxy

## 3.10.2

Expand Down
23 changes: 20 additions & 3 deletions ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,21 @@ main() {
# Grabs the major version of node from $npm_config_user_agent which looks like
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
major_node_version=$(echo "$npm_config_user_agent" | sed -n 's/.*node\/v\([^.]*\).*/\1/p')
if [ "$major_node_version" -lt 12 ]; then
echo "code-server currently requires at least node v12"

if [ -n "${FORCE_NODE_VERSION:-}" ]; then
echo "WARNING: Overriding required Node.js version to v$FORCE_NODE_VERSION"
echo "This could lead to broken functionality, and is unsupported."
echo "USE AT YOUR OWN RISK!"
fi

if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-14}" ]; then
echo "ERROR: code-server currently requires node v14."
if [ -n "$FORCE_NODE_VERSION" ]; then
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
fi
echo "We have detected that you are on node v$major_node_version"
echo "See https://github.com/cdr/code-server/issues/1633"
echo "You can override this version check by setting \$FORCE_NODE_VERSION,"
echo "but configurations that do not use the same node version are unsupported."
exit 1
fi

Expand Down Expand Up @@ -54,6 +65,12 @@ main() {
echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
exit 1
fi

if [ -n "${FORCE_NODE_VERSION:-}" ]; then
echo "WARNING: The required Node.js version was overriden to v$FORCE_NODE_VERSION"
echo "This could lead to broken functionality, and is unsupported."
echo "USE AT YOUR OWN RISK!"
fi
}

# This is a copy of symlink_asar in ../lib.sh. Look there for details.
Expand Down
3 changes: 2 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The prerequisites for contributing to code-server are almost the same as those f
[VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
There are several differences, however. Here is what is needed:

- `node` v12.x or greater
- `node` v14.x or greater
- `git` v2.x or greater
- [`yarn`](https://classic.yarnpkg.com/en/)
- used to install JS packages and run scripts
Expand Down Expand Up @@ -74,6 +74,7 @@ To update VS Code, follow these steps:
4. There will be merge conflicts. First commit them.
1. We do this because if we don't, it will be impossible to review your PR.
5. Once they're all fixed, test code-server locally and make sure it all works.
6. Check the version of Node.js that the version of Electron shipped with VSCode uses, and update the version of Node.js if necessary.

#### Notes about Changes

Expand Down
6 changes: 3 additions & 3 deletions docs/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

If you're installing the npm module you'll need certain dependencies to build the native modules used by VS Code.

- Node.js: version `>= 12`, `<= 14`
- Node.js: version `= 14`. Other versions may work, but your mileage may vary.

_Note: the Node.js version requirements are based on the VS Code Node.js requirements. See [here](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)._
_Note: We use the same major version of Node.js that is shipped in VSCode's Electron. VS Code also lists Node.js requirements. See [here](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)._

Related:

Expand Down Expand Up @@ -55,6 +55,6 @@ xcode-select --install
## FreeBSD

```sh
pkg install -y git python npm-node12 yarn-node12 pkgconf
pkg install -y git python npm-node14 yarn-node14 pkgconf
pkg install -y libinotify
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/express": "^4.17.8",
"@types/http-proxy": "^1.17.4",
"@types/js-yaml": "^4.0.0",
"@types/node": "~12.20.7",
"@types/node": "^14.17.1",
"@types/parcel-bundler": "^1.12.1",
"@types/pem": "^1.9.5",
"@types/proxy-from-env": "^1.0.1",
Expand Down Expand Up @@ -123,7 +123,7 @@
"browser-ide"
],
"engines": {
"node": ">= 12 <= 14"
"node": "= 14"
},
"jest": {
"transform": {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,10 @@
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256"
integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==

"@types/node@*", "@types/node@~12.20.7":
version "12.20.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.13.tgz#e743bae112bd779ac9650f907197dd2caa7f0364"
integrity sha512-1x8W5OpxPq+T85OUsHRP6BqXeosKmeXRtjoF39STcdf/UWLqUsoehstZKOi0CunhVqHG17AyZgpj20eRVooK6A==
"@types/node@*", "@types/node@^14.17.1":
version "14.17.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.1.tgz#5e07e0cb2ff793aa7a1b41deae76221e6166049f"
integrity sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
Expand Down