How Do I Get HouseMon Working?

Added by Zwilrich about 3 years ago

Yes, I know it is obsolete, but JeeLabs is about the journey.

I am following DIJN.09 – Install the HouseMon server and failing at the npm start step when is processed. The problem is that the logger module has been renamed as the morgan module. I've tried replacing logger with morgan but that didn't work. I've also tried adding morgan = require 'morgan' and logger = require 'morgan' without success.

Another issue is that the git repository doesn't seem to know about previous versions anymore. git checkout 0.7.x fails with the message error: pathspec '0.7.x' did not match any file(s) known to git. as does git checkout 0.7.0 and git checkout 0.7. I worked around that problem by downloading the version 0.7.0 zip file.

I am doing this on a Raspberry Pi 3 running Raspbian 8 (Jessie). The node version is v0.10.21 and the npm version is 1.3.11.

Here is the error message on npm start:

pi@pi3:~/housemon_0.7/housemon-0.7.0 $ npm start

> housemon@0.7.0 start /home/pi/housemon_0.7/housemon-0.7.0
> node app.js

pid 12764 Fri Mar 24 2017 11:38:42 GMT-0600 (MDT)

TypeError: Object function createServer() {
  function app(req, res, next){ app.handle(req, res, next); }
  merge(app, proto);
  merge(app, EventEmitter.prototype);
  app.route = '/';
  app.stack = [];
  return app;
} has no method 'logger'

Replies (2)

RE: How Do I Get HouseMon Working? - Added by jcw about 3 years ago

There's a git tag called "v0.7.0" in the jcw/housemon repository which points to everything as of 0.7.0.

Im guessing that this line is causing problems?

I'm not sure where the logger comes from - I've used the name "logger" as well, but that was later on, I think. From that source line, my hunch would be that it wants to log all HTTP requests. If so, you should be able to remove that code, as it's not essential to the functioning of the rest of HouseMon. But there may well be more dragons ahead - NodeJS and its packages have evolved at a rapid pace.

RE: How Do I Get HouseMon Working? - Added by Zwilrich about 3 years ago

Thanks for replying Jean-Claude.

I used the v0.7.0 tag to download the zip version. Trying to use git checkout 0.7.0 failed, as I mentioned above.

Yes, I think that is the line causing the problem. I guessing that when coffee gets turned into javascript, the line number becomes 91. From the comments in the source file, it looks like I can change from dev mode to production mode and eliminate the logging. Lines 86 and 87 might need to be commented out.

On the senchalabs web site it says that logger has been renamed to morgan. I tried replacing logger with morgan on line 73, without success. I tried that with both versions of require mentioned above.

Other suggestions welcomed.