Monday, 23 May 2016

Local Instance of Nightscout on Windows 10 - How I Got There

To do some fast development of new Nightscout features, I wanted to work away from Azure. "Easy!" I thought, already sitting at a laptop with GitHub and Node.js installed. Well I'm afraid it wasn't so. With the help of some fab' people (not least @MilosKozak, thank you!), I got there. Here's how:


This is what I needed to get going, versions are important!!
  • Node.js
  • Git (here?, I used Version 2.7)
  • Python (Version 2.x (no higher than 2!), I used 2.7.11 x64)
  • Microsoft Visual Studio Express 2013 (must be 2013)


I had to make sure both npm (Node Package Manager) and Git were on the user path. I also added some system varibales for Nightscout
(Settings > System > About > System Info > Advanced system settings > Evironment Variables...):

User Variable
  • PATH = C:\Users\[MyUserName]\AppData\Roaming\npm;C:\Program Files\Git\bin
System Variables
  • API_SECRET = [MyNightscoutAPISecret]
  • ENABLE = careportal iob cob openaps pump bwg rawbg basal
  • MONGO = [MyMongoconnectionString]
  • PORT = 80
  • PUMP_FIELDS = reservoir battery status


I had to ensure npm used the correct compiler from Visual Studio 2013:
  • Open Command Prompt ([Windows] + [R] > "cmd")
  • Enter "npm config set msvs_version 2013 --global"
Having done all of this, installation was simple..
  • Create a local copy of cgm-remote-monitor on machine (in my case using GitHub)
  • Open Command Prompt ([Windows] + [R] > "cmd")
  • Enter "cd [cgm-remote-monitor directory path]"
  • Enter "npm install"

Running Nightscout

  • From the open Command Prompt, enter "node server" 

Developing in an IDE

  • I used NTVS (Node Tools for Visual Studio) and followed this awesome video:

No comments:

Post a Comment