Apollon77 / node-mbus

Nodejs mbus module
MIT License
20 stars 15 forks source link

@serialport/bindings dependency seems to cause issues with Node.js 22 #123

Closed danielpeintner closed 2 months ago

danielpeintner commented 2 months ago

Describe the bug
In node-wot we tried to add Node.js 22 as CI dependency and the run fails with issues w.r.t. to @serialport/bindings

https://github.com/eclipse-thingweb/node-wot/actions/runs/8846329944/job/24291988667?pr=1274#step:5:13

To Reproduce
See https://github.com/eclipse-thingweb/node-wot/pull/1274. node-wot uses mbus in package binding-mbus.

Expected behavior npm ci or npm install should work.

Versions:
Tested node-mbus 2.1.0 and 2.2.2.

BTW, I noticed that https://www.npmjs.com/package/@serialport/bindings has been moved to https://www.npmjs.com/package/@serialport/bindings-cpp and has new version Maybe updating to the latest version of @serialport/bindings-cpp is enough.

Apollon77 commented 2 months ago

Would this not be an issue in node serialport then for first? then we can updte serialport library here :-)

v12.0 i still the last verison of serialport which was published. I would propose to open an issue there and then we see further. Feel free to link this issue into it.

danielpeintner commented 2 months ago

Please state me wrong but the node-mbus library does depend (directly or indirectly) on @serialport/bindings (v9.2.9 published 2 years ago) rather than the new @serialport/bindings-cpp (v12.0.1, released 9 month ago).

Apollon77 commented 2 months ago

hm ... where?

https://github.com/Apollon77/node-mbus/blob/master/package.json#L32-L43

Also in the GitHub committed package-lock.json there is not any string matching "serialport". So where do you find this depnedency in node-mbus?

But in fact your npm tree in your own monorepo (where btw ALL sub-packages matter and not just one) someone is referencing serialport https://github.com/eclipse-thingweb/node-wot/blob/master/package-lock.json#L608 ... and when I look at the versions there it is a very old serialport dep like 9.x, so yes it is referenced.

And when lookimg even deeper ... voilla ... https://github.com/eclipse-thingweb/node-wot/blob/master/package-lock.json#L6855 ... modbus-serial is your friend

I think you might want to upgrade modbus serial to latest patch release because there it brings serialport 12 with it ...

And because npm and mono repos are strange sometimes you could also try with out any change: delete package-lock AND node_modules and do "npm i" on root level, maybe this already solves your issue

danielpeintner commented 2 months ago

@Apollon77 sorry for the inconvenience I mixed up modbus with mbus 🙈

Apollon77 commented 2 months ago

lol ... :-) kk