Skip to content

Commit d4b3d21

Browse files
committed
Require minimum node 12
1 parent 40778b1 commit d4b3d21

File tree

7 files changed

+21
-4
lines changed

7 files changed

+21
-4
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ platform or architecture.
4141
**note:** Installing via `npm` requires certain dependencies for the native module builds.
4242
See [./doc/npm.md](./doc/npm.md) for installing these dependencies.
4343

44+
You also need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
45+
4446
```bash
4547
npm install -g code-server
4648
code-server

ci/build/npm-postinstall.sh

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
set -eu
33

44
main() {
5+
# Grabs the major version of node from $npm_config_user_agent which looks like
6+
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
7+
major_node_version=$(echo "$npm_config_user_agent" | sed -n 's/.*node\/v\([^.]*\).*/\1/p')
8+
if [ "$major_node_version" -lt 12 ]; then
9+
echo "code-server currently requires at least node v12"
10+
echo "We have detected that you are on node v$major_node_version"
11+
echo "See https://github.com/cdr/code-server/issues/1633"
12+
exit 1
13+
fi
14+
515
case "${npm_config_user_agent-}" in npm*)
616
# We are running under npm.
717
if [ "${npm_config_unsafe_perm-}" != "true" ]; then

ci/steps/publish-npm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ main() {
1111

1212
download_artifact npm-package ./release
1313
# https://github.com/actions/upload-artifact/issues/38
14-
chmod +x $(grep -rl '^#!/.\+' release)
14+
chmod +x $(grep -rl '^#!/.*' release)
1515
yarn publish --non-interactive release
1616
}
1717

ci/steps/release-static.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ main() {
55
cd "$(dirname "$0")/../.."
66

77
# https://github.com/actions/upload-artifact/issues/38
8-
chmod +x $(grep -rl '^#!/.\+' release)
8+
chmod +x $(grep -rl '^#!/.*' release)
99

1010
yarn release:static
1111
yarn test:static-release

doc/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Please refer to [VS Code's prerequisites](https://github.com/Microsoft/vscode/wi
99

1010
Differences:
1111

12-
- We are not constrained by node version
12+
- We require at least node v12 but later versions should work
1313
- We use [fnpm](https://github.com/goreleaser/nfpm) to build .deb and .rpm packages
1414

1515
## Development Workflow

doc/npm.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
If you're installing the npm module you'll need certain dependencies to build
44
the native modules used by VS Code.
55

6+
You also need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
7+
68
## Ubuntu, Debian
79

810
```bash

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,8 @@
9292
"coder",
9393
"vscode-remote",
9494
"browser-ide"
95-
]
95+
],
96+
"engines": {
97+
"node": ">= 12"
98+
}
9699
}

0 commit comments

Comments
 (0)