Skip to content

Commit

Permalink
Upgrade to Node 10 for Azure. Upgrade to version Node 8.15.0 for Node…
Browse files Browse the repository at this point in the history
  • Loading branch information
PieterGit committed Dec 31, 2018
1 parent bbb5ca9 commit 86a1c2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Minimum browser requirements for viewing the site:

Windows installation software requirements:

- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.14.0 or later) or Node 10 LTS (Node 10.14.2 or later). Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.15.0 or later) or Node 10 LTS (Node 10.14.1 or later). Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 3.x or later. MongoDB 2.4 is only supported for Raspberry Pi.

As a non-root user clone this repo then install dependencies into the root of the project:
Expand All @@ -144,7 +144,7 @@ Installation notes for Microsoft Azure, Windows:

- If deploying the software to Microsoft Azure, you must set ** in the app settings for *WEBSITE_NODE_DEFAULT_VERSION* and *SCM_COMMAND_IDLE_TIMEOUT* **before** you deploy the latest Nightscout or the site deployment will likely fail. Other hosting environments do not require this setting. Please use:
```
WEBSITE_NODE_DEFAULT_VERSION=8.11.1
WEBSITE_NODE_DEFAULT_VERSION=10.14.1
SCM_COMMAND_IDLE_TIMEOUT=300
```
- See [install MongoDB, Node.js, and Nightscouton a single Windows system](https://github.com/jaylagorio/Nightscout-on-Windows-Server). if you want to host your Nightscout outside of the cloud. Although the instructions are intended for Windows Server the procedure is compatible with client versions of Windows such as Windows 7 and Windows 10.
Expand Down
9 changes: 4 additions & 5 deletions lib/server/bootevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ function boot (env, language) {
function checkNode (ctx, next) {
var semver = require('semver');
var nodeVersion = process.version;
if ( semver.satisfies(nodeVersion, '^8.14.0') || semver.satisfies(nodeVersion, '^10.14.2')) {
if ( semver.satisfies(nodeVersion, '^8.15.0') || semver.satisfies(nodeVersion, '^10.15.0')) {
console.debug('Node version ' + nodeVersion + ' is supported');
next();
}
else if ( semver.eq(nodeVersion, '8.11.1')) {
console.log('WARNING: Node version v8.11.1 and Microsoft Azure are not recommended.');
console.log('WARNING: Please migrate to another hosting provider. Your Node version is considered insecure and' +
' has several security vulnerabilities. Use at your own risk.');
else if ( semver.eq(nodeVersion, '10.14.1')) {
console.log('WARNING: Node version v10.14.1 and Microsoft Azure are not recommended.');
console.log('WARNING: Please migrate to another hosting provider. Your Node version is outdated');
next();
} else {
// in all other cases don't start Node
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
},
"engines": {
"node": "^10.14.2 || ^8.14.1 || ~8.11.1",
"node": "^10.14.1 || ^8.15.0",
"npm": "6.x"
},
"dependencies": {
Expand Down

0 comments on commit 86a1c2f

Please sign in to comment.