tfjs-node always need to build from source
On my system:
Armbian Linux 6.12.50-current-rockchip64 v25.8 rolling for NanoPi R4S Debian stable (bookworm)
node v22.21.1
I always have to call
npm rebuild @tensorflow/tfjs-node --build-from-source
after
npm i
Otherwise I get "node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node: cannot open shared object file: No such file or directory"
Under this circumstance a production deployment is impossible...
Hi @rg-engineering , This is a known issue in TFJS , which can be resolved using 2 ways either running this cmd npm rebuild @tensorflow/tfjs-node --build-from-source or manually copy the file(tfjs_binding.node) to the working dir. Refer these for more information here. Please let us know that resolves your issue. Thank you.
Hi @avmohansai , thanks for your reply. In a development or prototype environment the suggested workaround might be acceptable. In my case I where I want to go for a production deployment for end users this workaround is not practicable and not user friendly especially if users with less experience in software should use my application.
Hi @rg-engineering , Thanks for your reply. I can understand your concern. This issue has already been escalated with the team, and it is one of our priority bugs.
Hi @rg-engineering,
Thank you for your patience, we have reproduced the issue. As a workaround, you can try to add a postinstall script to your application's package.json. NPM will automatically executes this script immediately after npm install finishes. Could you please try this and let us know if it works for you?
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.