Wednesday 17 May 2017

NodeJS: libxmljs could not build

This library is a hell. I could not consistently install it on an arbitrary Unix platform. I was able to get to OSX and alpine linux but now trying to install it for the same project on Cent OS and it is failing. It was failing the same way on other platforms but after numerous tries it got installed. Here I could not find a solution.

 npm install libxmljs

Here is the output

node-pre-gyp http GET https://github.com/libxmljs/libxmljs/releases/download/v0.18.4/node-v48-linux-x64.tar.gz
node-pre-gyp http 404 https://github.com/libxmljs/libxmljs/releases/download/v0.18.4/node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://github.com/libxmljs/libxmljs/releases/download/v0.18.4/node-v48-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for libxmljs@0.18.4 and node@6.9.5 (node-v48 ABI) (falling back to source compile with node-gyp) 
node-pre-gyp http 404 status code downloading tarball https://github.com/libxmljs/libxmljs/releases/download/v0.18.4/node-v48-linux-x64.tar.gz 
gyp http GET https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack     at exports._errnoException (util.js:1022:11)
gyp ERR! stack     at TLSWrap.onread (net.js:569:26)
gyp ERR! System Linux 4.4.27-boot2docker
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--loglevel=http" "--module=/opt/tc_base/Proj-Node/node_modules/libxmljs/build/Release/xmljs.node" "--module_name=xmljs" "--module_path=/opt/tc_base/Proj-Node/node_modules/libxmljs/build/Release"
gyp ERR! cwd /opt/tc_base/Proj-Node/node_modules/libxmljs
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
npm ERR! code ELIFECYCLE

npm ERR! libxmljs@0.18.4 install: `node-pre-gyp install --fallback-to-build --loglevel http`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the libxmljs@0.18.4 install script 'node-pre-gyp install --fallback-to-build --loglevel http'.
npm ERR! Make sure you have the latest version of node.js and npm installed.

Here it should be building it from source. And on some other platforms it is reluctantly doing it. But not on CentOS.

I tried different versions of Node. 6.9.5 gave me a best luck of getting it installed on other platforms. But on CentOS it seems to could not get installed no matter what.

Declaimer: It is a DOCKER version of CentOS. However should not really matter because after a long struggle it kinda got installed on alpine

I could not be the one struggling here because this thing should fail everywhere. Nothing special on the environment I have.



via Stan Sokolov

No comments:

Post a Comment