Tfjs: The Node.js native addon module (tfjs_binding.node) can not be found

Created on 24 Jul 2020  路  6Comments  路  Source: tensorflow/tfjs

To get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

TensorFlow.js version

1.7.4 / 2.0.1

Browser version

n/a

Describe the problem or feature request

When run mnist node: _/tfjs-examples/mnist-node $ node main.js_
It throws exception.

Code to reproduce the bug / link to feature request

If you would like to get help from the community, we encourage using Stack Overflow and the tensorflow.js tag.

GitHub issues for this repository are tracked in the tfjs union repository.

Please file your issue there, following the guidance in that issue template.
_/tfjs-examples/mnist-node $ node main.js_ throws exception:

/mnt/d/Source/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/dist/index.js:49
throw new Error("The Node.js native addon module (tfjs_binding.node) can not "
^

Error: The Node.js native addon module (tfjs_binding.node) can not be found at path: /mnt/d/Source/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v/tfjs_binding.node.
Please run command 'npm rebuild @tensorflow/tfjs-node build-addon-from-source' to rebuild the native addon module.
If you have problem with building the addon module, please check https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md or file an issue.
at Object. (/mnt/d/Source/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/dist/index.js:49:11)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/mnt/d/Source/tfjs-examples/mnist-node/main.js:18:12)
at Module._compile (module.js:652:30)

Not sure why it looks at tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v/tfjs_binding.node, it should look at tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v4/tfjs_binding.node

node.js builinstall

Most helpful comment

@oujiafan can you please check similar issue here.

All 6 comments

@oujiafan can you please check similar issue here.

Cool. It works.

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

Rebuild still didn't solve my issue (on windows at least, I tried on ubuntu and works fine).

I'm unable to get it working and I get the same error as the other issues

I have the same issue on window and rebuild didn't help

I was using a different node.js version that Electron was. so I installed node.js version is the same as the version of Electron is using (12.16.3) and that solved the problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weiji14 picture weiji14  路  3Comments

Arturbarth picture Arturbarth  路  3Comments

RELNO picture RELNO  路  3Comments

KienPM picture KienPM  路  3Comments

chrisdonahue picture chrisdonahue  路  3Comments