slashdotdash / node-ledger-web

Web front-end to access ledger cli data.
MIT License
144 stars 14 forks source link

Probably a 'wontfix', but there seems to be incompatibility with node v7 #10

Open paxperscientiam opened 7 years ago

paxperscientiam commented 7 years ago

Hello @slashdotdash

From what I can tell, node-ledger-web is incompatible with the latest versions of node.

I tried futzing around, but there appears to be quite a few things that are no longer supported by latest versions of node.

Here is the trace:

$ node app.js
util.js:965
    throw new TypeError('The super constructor to "inherits" must not ' +
    ^

TypeError: The super constructor to "inherits" must not be null or undefined
    at Object.exports.inherits (util.js:965:11)
    at Object.<anonymous> (/*SNIP*/node-ledger-web/node_modules/spdy/lib/spdy/connection.js:81:6)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/*SNIP*/node-ledger-web/node_modules/spdy/lib/spdy.js:20:19)
slashdotdash commented 7 years ago

Happy to accept a pull request to bring the code up-to-date.

paxperscientiam commented 7 years ago

Migrating from Express 3 to 4 is involved, but shouldn't be too painful. That said, I believe it is ledger-rest that is in conflict with node 7. I'll see if I can root out the problem.

slashdotdash commented 7 years ago

@paxperscientiam Workaround for you is to use nvm to install and use an earlier version of Node.

nvm install v4.1.0
nvm use v4.1.0
adius commented 7 years ago

Event better: Create a Dockerfile which builds the service 😉 (https://github.com/slashdotdash/node-ledger-web/issues/11)

TomK32 commented 7 years ago

Right, I've spent an hour with updating to express 4 and put that onto my fork. The app does load and show my ledger entries (an hledger file), even though it insists converting my € into £.

But it's a start, I'll dive into extending the app.

FullofQuarks commented 5 years ago

Issue still prevalent as of October 2019. Still get errors from a fresh clone, and following instructions. Changing node version to 4.1.0 does not solve the problem.

Changing node version to 6.17.1 allows the app to run, but then you get the following error:

_http_outgoing.js:369
    throw new Error('Can\'t set headers after they are sent.');
    ^

Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:369:11)
    at ServerResponse.res.setHeader (\node-ledger-web\node_modules\connect\lib\patch.js:63:22)
    at ServerResponse.format (\node-ledger-web\node_modules\restify\lib\response.js:98:10)
    at ServerResponse.send (\node-ledger-web\node_modules\restify\lib\response.js:208:24)
    at Server.<anonymous> (\node-ledger-web\node_modules\restify\lib\index.js:87:13)
    at emitMany (events.js:127:13)
    at Server.emit (events.js:201:7)
    at Domain.onError (\node-ledger-web\node_modules\restify\lib\server.js:776:18)
    at emitOne (events.js:96:13)
    at Domain.emit (events.js:188:7)