tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

tfjs-node always need to build from source

Open rg-engineering opened this issue 1 year ago • 7 comments

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...

rg-engineering avatar Nov 22 '25 19:11 rg-engineering

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.

avmohansai avatar Nov 24 '25 09:11 avmohansai

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.

rg-engineering avatar Nov 24 '25 18:11 rg-engineering

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.

avmohansai avatar Dec 02 '25 07:12 avmohansai

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?

nileshau-afk avatar Jul 10 '26 04:07 nileshau-afk

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.

github-actions[bot] avatar Jul 18 '26 02:07 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar Jul 25 '26 02:07 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Jul 25 '26 02:07 google-ml-butler[bot]