TooTallNate/node-weak

bindings.js not found

FrenchBen opened this issue · 2 comments

I'm using the gitbook-mermaid-plugin and running into a binding issue:

/srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:91
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/Debug/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/Release/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/out/Debug/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/Debug/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/out/Release/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/Release/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/build/default/weakref.node
 → /srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/compiled/5.7.1/linux/x64/weakref.node
    at bindings (/srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/node_modules/weak/lib/weak.js:7:35)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at new D (/srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/index.js:28:20)
    at module.exports (/srv/gitbook/node_modules/gitbook-plugin-mermaid/node_modules/phantom/node_modules/dnode/index.js:8:12)

The culprit line in weak/lib/weak.js is:

var bindings = require('bindings')('weakref.node');

I did find the 'weakref.node' file at the following location: build/Release/obj.target/weakref.node which is not one of the path searched. Why is it not in the proper spot aka build/Release/weakref.node?

Any idea how to fix this?

@FrenchBen did you get a solution for this? I´m currently facing the same issue in another library.

@HenningThiemann I don't remember exactly, but more than likely a clear of build artifacts + proper npm version did the trick.