easybotics / node-rpi-rgb-led-matrix

Pilot your rgb led matrix with Nodejs ! Nodejs binding of rpi-rgb-led-matrix library https://github.com/hzeller/rpi-rgb-led-matrix - Actively Maintained!
Do What The F*ck You Want To Public License
57 stars 17 forks source link

Cannot import this module with a dependency resolver #6

Open Kieran-Lynn opened 5 years ago

Kieran-Lynn commented 5 years ago

Im trying to use your library in a project of my own and want to be able to build my app using Rollup. But whenever I go to run my script I get

"Error: Cannot find module '/home/pi/node-led-display/dist/build/Release/node-rpi-rgb-led-matrix.node'"

I believe the issue is line 12 in your index.js file. It looks like you're trying to import the old node rpi led matrix (https://www.npmjs.com/package/node-rpi-rgb-led-matrix) but doing it in a weird way. Why wasnt it just listed as a dependency in your package.json? I believe this would fix my issue and my dependency resolver would be able to find the original node-rip-rgb-led-matrix package.

keptan commented 5 years ago

ill look into this thanks

Kieran-Lynn commented 5 years ago

Awesome thanks, If you need any more information from me please let me know, I can send you my rollup config and my code but its failing on the import easybotics statement when trying to compile.

I believe I had a similar problem when using webpack but I cant remember exactly what that error was.

Thanks!

Kieran-Lynn commented 5 years ago

any update @keptan

keptan commented 5 years ago

I looked into it further I will try and change it, but what's being done is apparently a supported way of importing compiled node-gyp binaries https://github.com/mapbox/node-pre-gyp

clowrey commented 4 years ago

@keptan any update on this?

ryanmich251 commented 3 years ago

Line 12 should be importing the nodejs bindings for this module, which will only exist after this module gets built. I'm not familiar with rollup, but the issue may be that rollup isn't actually building the module, so it can't find that file.

I'm assuming this probably isn't a problem anymore, based on the fact the issue's a year and a half old now.