all I did was install node.js. run nmp insall and then npm start --production or something like that and was up and running. I am running node natively on windows 10. I was looking at moving it over to IIS, but not sure if I want to or not.
Ahhhh, give me 5 minutes. I’m trying an experiment
ok, sounds good.
Here is what i did.
Start by fixing your dependencies. Invoke the following command:
npm install --production
This will download the necessary dependencies if possible.
start the server by running
npm start
Now you can control your system by invoking the following commands:
Holy shit…LOL So, damn, easy…
Ok. Those instructions are Linux only. Trash them. For Windows:
Step 1: Git clone (or just download) the harmony-api.
Step 2: cd to where you cloned the api to (in my instance, D:\harmony-api)
Step 3: npm install -g forever
Step 4: npm install
Step 5: copy D:\harmony-api\config\config.sample.json D:\harmony-api\config.json
Step 6: node app.js
Mine is still discovering, so I don’t know if there is an issue there or not, but I got it running in a Windows command shell:
I get this error at step 4
C:\NodeJS\harmony-api>npm install
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache_logs\2018-02-22T15_12_57_
613Z-debug.log
Im running windows 8.1 if that matters…
That means you need to install Git on your machine (or make sure that your git binary is in your path).
I can run npm install in my cast-web-api directory no problem. I only see that error in the harmony api directory, how to I add that binary to this path? I tried running npm install --save npm-git-install but still getting the error
I am getting the identical error.
echo %path% (in a command prompt). You should see your git binary in there (usually C:\Program Files\Git\bin). However, even with that removed, npm install shouldn’t need to use the git binary as it just pulls directly from the git https url.
Honestly, I’m going to say that the Windows way of using node and docker to host this is too damn unreliable. On my Liunx server, I’ve run this a dozen times or more. On Windows, it fails in some way no matter what. Currently, I have it setup and I can run it, but it just sits at “Discovering devices” and then does nothing. Thinking it could be the firewall, I turned it off. Same results.
This is running on my linux server:
This is running on my Windows 10 desktop:
I didn’t write the code (nor did @KuKu), so in terms of getting it working on Windows, I’d need to go in and start debugging the script. I’ll start doing that, but it’ll take me a bit.
Ok, so I figured out the git issue. Maddox is using “harmonyhubjs-client”: “maddox/harmonyhubjs-client#for-harmony-api” in his package.json. This is triggering npm to want to use an external git resource to grab those files (think of it like an external repository). The reason why cast-web-api doesn’t trigger this, no external git resources in the package.json file for that. To fix it, install Git for Windows, accept all the defaults, and then try doing the npm install -g again.
However, there’s still issue #2: Discovery on Windows. It looks like the local firewall rules are blocking the discovery on port 5224. When I add an explicit rule for that in the Windows firewall, I can get devices to discover, but then it crashes out. I’m still debugging it on my Win10 system, but I’m not 100% confident that I can get it to work.
What containers are you running in docker on Windows? You can run either Linux containers or windows containers, but not both (based on my experience). Maddox’s should be running on x86 architecture in a Linux container.
@Core_Phx so I have github desktop installed, still getting the same error.
Does that include Git for Windows? (https://git-scm.com/download/win)
That’s what I have installed for Git. I don’t think Github Desktop includes the actual command line Git utilities (I’ve never used/installed it).
ok, I now have starting discovery, which is just sitting
Can’t we put in the IP of the hub to find it manually?
Maybe in the config.json? I don’t know. I’m still trying to figure out where it’s hanging up when it’s doing discovery. I’ve traced back to \harmony-api\node_modules\harmonyhubjs-discover\lib\ping.js, but I haven’t gotten farther than that yet.
I don’t know. I haven’t tried running it in docker. I was stating that on this thread, I’ve not seen anyone run it successfully on Windows.
Thanks for all your help I’m up and running now! I didnt have to mess with my firewall, my hub and activities/devices were discovered and added. I’m not at home right now to test it out but everything appears to be humming along.
@David_Van are you running this on windows?
yeah windows 8.1 pro, not using docker.