node.js - "libxmljs" module error
Asked Answered
N

0

6
node -v
v4.4.7
npm -v
v2.15.8
node-gyp -v
v3.4.0

I'm trying to run my node app which uses libxmljs module and i'm getting this wierd error:

libxmljs/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: /link/node_modules/libxmljs/build/Release/xmljs.node: undefined symbol: _ZN2v82V837AdjustAmountOfExternalAllocatedMemoryEl
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    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 bindings (/link/node_modules/libxmljs/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/link/node_modules/libxmljs/lib/bindings.js:1:99)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

I tried to npm update and installing libxmljs again. Doesn't work. Any tips?

Neeley answered 21/7, 2016 at 17:21 Comment(18)
Did you install that module with a different Node version than that you're using now?Gripping
@Gripping No, but i DID upgrade node lately. Is it possible that there are two versions of node installed and that this module reference the older one ? If so, how can I complete remove the older ?Neeley
I don't think that that can happen. Did you try and reinstall the module (remove it from node_modules first, just to be sure) with your current Node version?Gripping
@Gripping did it now. Now i'm getting this error: "Error: Could not locate the bindings file." I've rebuild it with node-gyp, and now I'm getting the error in the question again :(Neeley
Why not just use npm i libxmljs?Gripping
@Gripping what does the "i" mean ?Neeley
Short for installGripping
@Gripping I don't understand. I did it.Neeley
You initially said in your comment that you ran sudo node-gyp rebuild, which shouldn't be necessary if you re-install the package. I just installed the package myself (same Node version), that worked fine for me.Gripping
@Gripping ok.. but it's kind of the same.. I'm still stuck with that issue. It's important to mention that I'm installing that module inside another module I build. The app i'm running uses that module I'm building, but I didn't install libxmljs for it (only install it for the module I'm building)Neeley
@Gripping can you try to install it in a module within your app ?Neeley
Tried that, worked just fine. I assume that your module has libxmljs declared as a (regular) dependency?Gripping
@Gripping what do you mean regular dependency? I've just npm install it, and require it inside my codeNeeley
Declared in the dependencies object of the package.json that belongs to your module.Gripping
@Gripping yes. I'm always using --saveNeeley
If you changed node version on your system, then binary libraries can not to bind correctly with it. This is a common issue but easy to solve: If you always install your modules with npm install --save, just need to remove (or rename) node_modules directory and then execute npm install to rebuild it. If you installed any modules without the '--save' option, then you should reinstall it by hand (better with '--save' this time).Inkling
have you resolved this issue?Inoculate
@MuneemHabib Yes. The problem is that i've installed node via apt-get. The environment wasn't updated with the latest version/Neeley

© 2022 - 2024 — McMap. All rights reserved.