Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node-XMPP stringprep error

I'm using node-xmpp using browserify for web application. When I try to make a for browser file using browserify, the resulting file outputs this in js console -

Cannot load StringPrep-0.1.0 bindings. You may need to npm install node-stringprep client.js:5108 Cannot load StringPrep-0.2.3 bindings (using fallback). You may need to npm install node-stringprep client.js:34 Cannot load StringPrep-0.2.3 bindings (using fallback). You may need to npm install node-stringprep

After which the code fails saying

Uncaught TypeError: undefined is not a function

The file client.js work fine when i use in terminal

node client.js

There is nothing much in client.js

var xmpp = require('simple-xmpp');

xmpp.connect({
    jid                 : 'loginid',
    password            : 'password',
    host                : 'localhost',
    port                : 5222
});

xmpp.on('online', function() {
    console.log('Yes, I\'m connected!');
});

xmpp.on('chat', function(from, message) {
    xmpp.send(from, 'echo: ' + message);
});

xmpp.on('error', function(err) {
    console.error(err);
});

xmpp.on('subscribe', function(from) {
if (from === '[email protected]') {
    xmpp.acceptSubscription(from);
    }
});

which I simply took from their documentation. Any pointers ??

like image 200
rougebot Avatar asked Feb 01 '14 10:02

rougebot


1 Answers

If its Fedora try

yum install libicu-devel

libicu "provides Unicode and Globalization support for software applications" and I guess the up-to-date version of this is needed by node-xmpp.

On a Debian 6 system

apt-get install libicu-dev

might work.

https://github.com/node-xmpp/node-stringprep

like image 159
niksmac Avatar answered Sep 28 '22 02:09

niksmac