tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.51k stars 1.94k forks source link

Error trying to install DanfoJs, The Node.js native addon module (tfjs_binding.node) can not be found at path #3867

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.

rthadur commented 4 years ago

@samiragol we don't actually have windows machine to try this , but can you please list down steps what you are doing ? Also please specify tfjs versions.

samiragol commented 4 years ago

the steps are exactly as I mentioned above. here are the versions:

@tensorflow/tfjs@2.3.0 @tensorflow/tfjs-node-gpu@2.3.0 node 12.18.1

samiragol commented 4 years ago

when I ran node-gyp configure --verbose the process throw this log:

λ node-gyp configure --verbose
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\p2761065\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'configure',
gyp verb cli   '--verbose'
gyp verb cli ]
gyp info using node-gyp@7.1.0
gyp info using node@12.18.1 | win32 | x64
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - executable path is "C:\Python38\python3.exe"
gyp verb find Python - executing "C:\Python38\python3.exe" to get version
gyp verb find Python - version is "3.8.3"
gyp info find Python using Python version 3.8.3 found at "C:\Python38\python3.exe"
gyp verb get node dir no --target version specified, falling back to host node version: 12.18.1
gyp verb command install [ '12.18.1' ]
gyp verb install input version string "12.18.1"
gyp verb install installing version: 12.18.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 12.18.1
gyp verb build dir attempting to create "build" dir: C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator\build
gyp verb build dir "build" dir needed to be created? C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator\build
gyp verb find VS msvs_version not set from command line or npm config
gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp verb find VS checking VS2017 (15.9.28307.1177) found at:
gyp verb find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp verb find VS - found "Visual Studio C++ core features"
gyp verb find VS - found VC++ toolset: v141
gyp verb find VS - found Windows SDK: 10.0.17763.0
gyp info find VS using VS2017 (15.9.28307.1177) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python38\python3.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\p2761065\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\p2761065\\Projects\\Charter_Gateway4\\screenpop-emulator\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\p2761065\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\p2761065\\AppData\\Local\\node-gyp\\Cache\\12.18.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\p2761065\\AppData\\Local\\node-gyp\\Cache\\12.18.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\p2761065\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\p2761065\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\12.18.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\p2761065\\Projects\\Charter_Gateway4\\screenpop-emulator',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\p2761065\\Projects\\Charter_Gateway4\\screenpop-emulator\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp: binding.gyp not found (cwd: C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\p2761065\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\p2761065\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--verbose"
gyp ERR! cwd C:\Users\p2761065\Projects\Charter_Gateway4\screenpop-emulator
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v7.1.0
gyp ERR! not ok
rthadur commented 4 years ago

@samiragol can please take a look at similar issue here..!

samiragol commented 4 years ago

@

@samiragol can please take a look at similar issue here..!

the link you referred is an issue with installing tensorflow but I am be able to install it, I get error when I try to run node after installing DanfoJS package. and from the error looks like its something relate to tensorflow

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

rthadur commented 4 years ago

Thank you , glad it worked for you !

google-ml-butler[bot] commented 4 years ago

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