javascriptnode.jsinstallationnode-xmpp

Error installing node-xmpp-server module


I am trying to implement a requirement on node-xmpp-server, but i am facing issue while installing this module. I have read the blog on how to install and read few other blog posts too, but nothing is helping me out.

When I am trying to use npm install with the dependency mentioned in package.json or if I explicitly install the module, i am getting following error:

> node-stringprep@0.5.2 install /home/gaurav/NodeOffcRepo/chatPro/node_modules/node-xmpp-server/node_modules/node-xmpp-core/node_modules/node-stringprep
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack     at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack     at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:722:7)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at maybeClose (child_process.js:999:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1071:5)
gyp ERR! System Linux 3.8.0-19-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gaurav/NodeOffcRepo/chatPro/node_modules/node-xmpp-server/node_modules/node-xmpp-core/node_modules/node-stringprep
gyp ERR! node -v v0.13.0-pre
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 
npm ERR! node-stringprep@0.5.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-stringprep@0.5.2 install script.
npm ERR! This is most likely a problem with the node-stringprep 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-stringprep
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-xmpp-server"
npm ERR! cwd /home/gaurav/NodeOffcRepo/chatPro
npm ERR! node -v v0.13.0-pre
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
|
> node-expat@2.3.1 install /home/gaurav/NodeOffcRepo/chatPro/node_modules/node-xmpp-server/node_modules/node-xmpp-core/node_modules/ltx/node_modules/node-expat
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack     at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack     at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:722:7)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at maybeClose (child_process.js:999:16)
gyp ERR! stack     at Socket.<anonymous> (child_process.js:1167:11)
gyp ERR! stack     at Socket.emit (events.js:107:17)
gyp ERR! stack     at Pipe.close (net.js:461:12)
gyp ERR! System Linux 3.8.0-19-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gaurav/NodeOffcRepo/chatPro/node_modules/node-xmpp-server/node_modules/node-xmpp-core/node_modules/ltx/node_modules/node-expat
gyp ERR! node -v v0.13.0-pre
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/gaurav/NodeOffcRepo/chatPro/npm-debug.log
npm ERR! not ok code 0

My node version is: v0.13.0-pre

If some more info is needed, please comment.


Solution

  • Check if the dependencies of node-xmpp module is installed.

    Try to see node xmpp documentation

    You need to install first node-expat which is dependent of libexpat library. I tried

    yum install libexpat

    but it does not exist. I was able to find another library which helps.

    Try:

    (for CentOS)

    yum install libicu-devel

    (for Debian 6 system)

    apt-get install libicu-dev

    Then

    npm install node-expat

    Then you can install node-xmpp module.