node-ledger-web icon indicating copy to clipboard operation
node-ledger-web copied to clipboard

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

Open paxperscientiam opened this issue 7 years ago • 6 comments

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)

paxperscientiam avatar Jan 10 '17 04:01 paxperscientiam

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

slashdotdash avatar Jan 10 '17 12:01 slashdotdash

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.

paxperscientiam avatar Jan 10 '17 19:01 paxperscientiam

@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

slashdotdash avatar Jan 21 '17 00:01 slashdotdash

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

adius avatar Apr 02 '17 08:04 adius

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.

TomK32 avatar Apr 21 '17 08:04 TomK32

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)

FullofQuarks avatar Oct 01 '19 19:10 FullofQuarks