Can't build tfjs-node on Windows 10; module_name not defined in binding.gyp.
See original GitHub issueI’m unable to run tfjs-node. It reports a missing bindings file. I see the file in my project, but I haven’t found a way to include it (via import or require).
I’m not certain, but it looks like “module_name” is referenced without being defined in binding.gyp
Hope this helps.
VS Code Windows 10 x64 node 14.13.1 python 2.7.17
Stack:
(WORKSPACE)\node_modules@tensorflow\tfjs-node>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:\…\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@14.13.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 - “python3” is not in PATH or produced an error
gyp verb find Python checking if “python” can be used
gyp verb find Python - executing “python” to get executable path
gyp verb find Python - executable path is “C:\Python27\python.exe”
gyp verb find Python - executing “C:\Python27\python.exe” to get version
gyp verb find Python - version is “2.7.17”
gyp info find Python using Python version 2.7.17 found at “C:\Python27\python.exe”
gyp verb get node dir no --target version specified, falling back to host node version: 14.13.1
gyp verb command install [ ‘14.13.1’ ]
gyp verb install input version string “14.13.1”
gyp verb install installing version: 14.13.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: 14.13.1
gyp verb build dir attempting to create “build” dir: C:\Users.…\PROJECT\node_modules@tensorflow\tfjs-node\build
gyp verb build dir “build” dir needed to be created? C:\Users.…\PROJECT\node_modules@tensorflow\tfjs-node\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.960) 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.960) 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.…\PROJECT\node_modules@tensorflow\tfjs-node\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\Users.…\PROJECT\node_modules@tensorflow\tfjs-node\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users.…\PROJECT\node_modules@tensorflow\tfjs-node\common.gypi
gyp verb gyp gyp format was not specified; forcing “msvs”
gyp info spawn C:\Python27\python.exe
gyp info spawn args [
gyp info spawn args ‘C:\Users\…\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\…\OneDrive\…\node_modules\@tensorflow\tfjs-node\build\config.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘C:\Users\…\AppData\Roaming\npm\node_modules\node-gyp\addon.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘C:\Users\…\AppData\Local\node-gyp\Cache\14.13.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\…\AppData\Local\node-gyp\Cache\14.13.1’,
gyp info spawn args ‘-Dnode_gyp_dir=C:\Users\…\AppData\Roaming\npm\node_modules\node-gyp’,
gyp info spawn args ‘-Dnode_lib_file=C:\\Users\\…\\AppData\\Local\\node-gyp\\Cache\\14.13.1\\<(target_arch)\\node.lib’,
gyp info spawn args ‘-Dmodule_root_dir=C:\Users\…\OneDrive\…\node_modules\@tensorflow\tfjs-node’,
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\…\OneDrive\…\node_modules\@tensorflow\tfjs-node\build’,
gyp info spawn args ‘-Goutput_dir=.’
gyp info spawn args ]
gyp: Undefined variable module_name in binding.gyp 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.…\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\…\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js” “configure” “–verbose”
gyp ERR! cwd C:\Users.…\PROJECT\node_modules@tensorflow\tfjs-node
gyp ERR! node -v v14.13.1
gyp ERR! node-gyp -v v7.1.0
gyp ERR! not ok
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top GitHub Comments
Hi, I am encountering the same problem. How did you copied the dll? I cannot find it anywhere.
Edit: Well, I just forced everything to look the same as it requires, like I see napi-v7 in my module and I created a soft link name napi-v8. After that, it seems like installed without a problem. In case anyone is facing the same issue and doesn’t known much about node.js just like me, here is the code in powershell.
@joemullenix-ks Looks like your issue is related to this bug https://github.com/tensorflow/tfjs/issues/4257, basically the dll file is not copied properly, when the node version is > 14.x