Skip to content

Commit a79d4c8

Browse files
hannesnemhoeger
authored andcommitted
Clarified incompatible node version error message. (#165)
* Fixed order of commands in Readme, to build before test. * Updated version checking message to explain Stable, and remove Current (v10 is not current) * Updated version message and compatible version list variables
1 parent d665503 commit a79d4c8

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
- `git clone https://github.com/Azure/azure-functions-nodejs-worker`
99
- `cd azure-functions-nodejs-worker`
1010
- `npm install`
11-
- `npm test`
1211
- `npm run build`
1312
- generate protobuf definitions & run typescript compiler
13+
- `npm test`
1414
- `$env:WORKERS__NODE__PATH = <path-to-nodejsWorker.js>`
1515
- configure the functions host to use the development version of the worker
1616

src/nodejsWorker.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var logPrefix = "LanguageWorkerConsoleLog";
22
var errorPrefix = logPrefix + "[error] ";
3-
var ACTIVE_LTS_VERSION = "v8";
4-
var CURRENT_BRANCH_VERSION = "v10";
3+
var supportedVersions:string[] = ["v8","v10"];
54
var worker;
65

76
// Try validating node version
@@ -15,12 +14,12 @@ function validateNodeVersion(version) {
1514
// process.version returns invalid output
1615
if (versionSplit.length != 3){
1716
message = "Could not parse Node.js version: '" + version + "'";
18-
// Unsupported version
19-
} else if (major != ACTIVE_LTS_VERSION && major != CURRENT_BRANCH_VERSION) {
17+
// Unsupported version note: Documentation about Node's stable versions here: https://github.com/nodejs/Release#release-plan and an explanation here: https://medium.com/swlh/understanding-how-node-releases-work-in-2018-6fd356816db4
18+
} else if (supportedVersions.indexOf(major) < 0) {
2019
message = "Incompatible Node.js version. The version you are using is "
21-
+ version +
22-
", but the runtime requires an even-numbered Active LTS or Current version (ex: 8.11.1 or 10.14.1). "
23-
+ "For deployed code, change WEBSITE_NODE_DEFAULT_VERSION in App Settings. Locally, upgrade the node version used by your machine (make sure to quit and restart your code editor to pick up the changes).";
20+
+ version +
21+
", but the runtime requires an LTS-covered major version (ex: 8.11.1 or 10.14.1). LTS-covered versions have an even major version number (8.x, 10.x, etc.) as per https://github.com/nodejs/Release#release-plan. "
22+
+ "For deployed code, change WEBSITE_NODE_DEFAULT_VERSION in App Settings. Locally, install or switch to a supported node version (make sure to quit and restart your code editor to pick up the changes).";
2423
}
2524
// Unknown error
2625
} catch(err) {

0 commit comments

Comments
 (0)