5

I am trying to install node_xslt module in node 0.12 but it is failing. I have python version 2.7 and node-gyp version 2.0.2.

Here is the error stack-

> node_xslt@0.1.9 preinstall /home/ritesh/Ritesh/projects/applane1/node_modules/node_xslt
> node-gyp rebuild

/bin/sh: 1: xml2-config: not found
gyp: Call to 'xml2-config --cflags' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ritesh/Ritesh/projects/applane1/node_modules/node_xslt
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node_xslt"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! node_xslt@0.1.9 preinstall: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node_xslt@0.1.9 preinstall script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node_xslt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node_xslt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /node_modules/npm-debug.log

This error comes while installing other modules as well i.e. xslt4node.

Ritesh Bansal
  • 3,108
  • 2
  • 16
  • 23
  • according to your log install is using `gyp ERR! node-gyp -v v1.0.3` not `2.0.2` as you expected – Alex Sep 30 '15 at 21:13

3 Answers3

10

Just had the same problem, though the question is 5+ years old, might be useful for somebody else. I solved my problem switching to a different version of node with nvm: nvm use 12 in my case.

Georgy
  • 2,410
  • 3
  • 21
  • 35
2

Try installing compile tools

sudo apt-get install python3 g++ make python3-pip 

Works for me

1

Try installing sudo apt-get install libxml2-dev

Hiren S.
  • 2,793
  • 15
  • 25