javascriptdata / danfojs

Danfo.js is an open source, JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.
https://danfo.jsdata.org/
MIT License
4.81k stars 209 forks source link

Error: The Node.js native addon module (tfjs_binding.node) can not be found at path... #20

Closed samiragol closed 4 years ago

samiragol commented 4 years ago

I am trying to install DanfoJS on windows 10 using below command:

npm install danfojs-node

but I get following error when I run npm start

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

I tried to ran npm rebuild @tensorflow/tfjs-node build-addon-from-source but still having problem.

risenW commented 4 years ago

This error is from TFJS. I've noticed it for Windows users. Here's a link to a similar GitHub issue on the TFjs issues page, see if it works for you. https://github.com/tensorflow/tfjs/issues/2046

samiragol commented 4 years ago

I tried almost everything was mentioned on the issue page you forwarded, still having same problem :(

samiragol commented 4 years ago

here is my package.json:

"devDependencies": {
    "babel-polyfill": "^6.26.0",
    "electron": "^10.1.0",
    "electron-packager": "^13.1.1"
  },
  "dependencies": {
    "@tensorflow/tfjs-node": "^2.3.0",
    "body-parser": "^1.18.3",
    "danfojs-node": "^0.1.4",
    "electron-log": "^3.0.6",
    "express": "^4.16.4",
    "local-devices": "^2.0.0",
    "node-thermal-printer": "^4.1.0",
    "react-select": "^3.1.0",
    "regenerator-runtime": "^0.13.5",
    "ws": "^7.2.0",
    "xml2js": "^0.4.22",
    "xpath": "0.0.27",
    "yargs": "^14.0.0"
  },
risenW commented 4 years ago

I think I see the issue, danfo-node uses @tensorflow/tfjs-node": "^2.1.0", so I think it is conflicting with the current version. Try removing the @tensorflow/tfjs-node": "^2.3.0" dependencies and run npm install again

samiragol commented 4 years ago

ok I did what you said and still having the same issue. current package.json:

  "devDependencies": {
    "babel-polyfill": "^6.26.0",
    "electron": "^10.1.0",
    "electron-packager": "^13.1.1"
  },
  "dependencies": {
    "@tensorflow/tfjs-node": "^2.1.0",
    "body-parser": "^1.18.3",
    "danfojs-node": "^0.1.4",
    "electron-log": "^3.0.6",
    "express": "^4.16.4",
    "local-devices": "^2.0.0",
    "node-thermal-printer": "^4.1.0",
    "react-select": "^3.1.0",
    "regenerator-runtime": "^0.13.5",
    "ws": "^7.2.0",
    "xml2js": "^0.4.22",
    "xpath": "0.0.27",
    "yargs": "^14.0.0"
  },
risenW commented 4 years ago

I'm sorry, I meant to remove the Tensorflow dependency and then run npm install

samiragol commented 4 years ago

yeah I tried removing Tensorflow dependency first and I ran npm install I got same error and then I tried npm i @tensorflow/tfjs-node@2.1.0 and still the same issue

"devDependencies": {
    "babel-polyfill": "^6.26.0",
    "electron": "^10.1.0",
    "electron-packager": "^13.1.1"
  },
  "dependencies": {
    "body-parser": "^1.18.3",
    "danfojs-node": "^0.1.4",
    "electron-log": "^3.0.6",
    "express": "^4.16.4",
    "local-devices": "^2.0.0",
    "node-thermal-printer": "^4.1.0",
    "react-select": "^3.1.0",
    "regenerator-runtime": "^0.13.5",
    "ws": "^7.2.0",
    "xml2js": "^0.4.22",
    "xpath": "0.0.27",
    "yargs": "^14.0.0"
  },
risenW commented 4 years ago

That's weird. Have you tried a clean start? you could start a new project in a different director, and try to install danfo-node without TensorFlow dependency added Meanwhile, I'll try to replicate your issue here. What is your OS spec?

samiragol commented 4 years ago

I tried deleting node_modules several times, with and without TensorFlow dependency. I'm on windows 10 x64.

risenW commented 4 years ago

You can actually use Tensorflowjs with directly install it. Since it is a dependency of danfojs, it gets installed automatically. So I'm definitely sure the issue is coming from windows build.

  1. Try installing version 2.1.0 of Tensorflowjs and see if you can build it successfully.

If not, you may need to download the windows-build-tools (https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md#msbuildexe-exceptions

  1. If you can successfully build TFjs, then, Do a clean start, and npm install danfojs-node in your project. Do not install Tensorflowjs again, and do not add it to the package.json file. You should be able to import and use it.
samiragol commented 4 years ago

I did all these steps already and I just did it again since you asked me and no luck :( Just to mention I have both python 2.7 and 3.8 and I suspect I have to set a default to target one of them.

risenW commented 4 years ago

Did you solve this issue?

samiragol commented 4 years ago

no unfortunately I am still looking for solution. I am going to try different node versions to see if it will work

samiragol commented 4 years ago

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

risenW commented 4 years ago

That's great, I'll go ahead and close this issue now.