buglabs/node-xml2json

Error: Could not locate the bindings file.

avtaniket opened this issue · 2 comments

Error: Could not locate the bindings file. Tried: → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/build/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/build/Debug/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/build/Release/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/out/Debug/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/Debug/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/out/Release/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/Release/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/build/default/node_expat.node → /home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/compiled/4.9.1/linux/x64/node_expat.node at bindings (/home/ubuntu/deo-services/node_modules/bindings/bindings.js:93:9) at Object.<anonymous> (/home/ubuntu/deo-services/node_modules/xml2json/node_modules/node-expat/lib/node-expat.js:4:32) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/ubuntu/deo-services/node_modules/xml2json/lib/xml2json.js:1:75) at Module._compile (module.js:409:26)

  • Node 4.9
  • NPM : 2.15.11

I have the same issue:

 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/build/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/build/Debug/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/build/Release/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/out/Debug/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/Debug/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/out/Release/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/Release/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/build/default/node_expat.node
 → /Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/compiled/8.11.3/darwin/x64/node_expat.node
    at bindings (/Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/bindings/bindings.js:96:9)
    at Object.<anonymous> (/Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/node-expat/lib/node-expat.js:4:32)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/sr1/Developer/Node-Image-Process/XML-Scrape/node_modules/xml2json/lib/xml2json.js:1:75)```

node: 8.11.3
npm: 5.6.0

I had this issue as well. To fix it, I set the npm_config_node_gyp variable to point to the node-gyp executable and ran node-gyp rebuild in the node_modules\node-expat folder. e.g.
export npm_config_node_gyp=C:\\Users\\781990\\AppData\\Roaming\\nvm\\v6.11.0\\node_modules\\node-gyp\\bin\\node-gyp.js
cd node_modules\node-expat
node-gyp rebuild