question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node-gyp configure --verbose "gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp"

See original GitHub issue

I’m seeing the doc about windows troubleshooting because i have a unexpected error while i’m trying to use @tensorflow/tfjs-node module. That are my versions:

Python: 2.7.18 Node: 10.17.0 NPM: 7.1.2

When i call require(“@tensorflow/tfjs-node”) in any program, i got this error:

Error: The Node.js native addon module (tfjs_binding.node) can not be found at path: C:\Users\Marco\node_modules\@tensorflow\tfjs-node\lib\napi-v5\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.

I trying to rebuild the package and it’s all right:

npm rebuild @tensorflow/tfjs-node build-addon-from-source rebuilt dependencies successfully

Then, I looked the doc and i go to node_modules/@tensorflow/tfjs-node and i run the command

node-gyp configure --verbose

but I see the error:

gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp

What can I do in that case?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
google-ml-butler[bot]commented, Jan 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

0reactions
djbreen7commented, Jul 12, 2021

Same problem here: tfjs-node: 3.7.0 node.js: 14.16.0 npm: 6.14.11 electron: 12.0.14

No luck in WSL.

Also worth noting: It works fine when I’m serving the app in development mode. I only have issues when I package the application and install it.

I can’t upgrade to a higher version of node/npm because it will break electron. LTS (13.1.6) electron still uses node.js 14.6.0. Furthermore, node.js 14.6.0 uses Node-API v7.

I’ve done a lot of digging today. This binding.gyp error is the latest find. I read of other packages with a similar issue being resolved when developers downgraded from npm 7.x to 6.x. I tried both 6.x and 7.x here with no luck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined variable module_name in binding.gyp while ...
I'm trying to use meteor-up to deploy my app from OSX to a Ubuntu 14.04 x64 system, but it's throwing an error gyp:...
Read more >
MAC npm install issue with gyp
I was trying to install the npm, but ...
Read more >
Undefined variable module_name in binding.gyp while ...
gyp : Undefined variable module_name in binding.gyp while trying to load binding.gyp - 飞叶飞花- 博客园
Read more >
node-gyp | Yarn - Package Manager
node -gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. It contains a vendored copy of...
Read more >
Native modules built by node-gyp/npm is now supported
As we're working on NW13 we found that native modules built by node-gyp ... gyp: Undefined variable module_name in binding.gyp while trying to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found