Giter VIP home page Giter VIP logo

node-stringprep's Introduction

node-stringprep

Build Status

Flattr this!

Exposes predefined Unicode normalization functions that are required by many protocols. This is just a binding to ICU, which is said to be fast..

If ICU is not available then we make use of JavaScript fallbacks.

Usage

    var StringPrep = require('node-stringprep').StringPrep;
    var prep = new StringPrep('nameprep');
    prep.prepare('Äffchen')  // => 'äffchen'

For a list of supported profiles, see node-stringprep.cc

Javascript fallbacks can be disabled/enabled using the following methods on the StringPrep object:

var prep = new StringPrep('resourceprep')
prep.disableJsFallbacks()
prep.enableJsFallbacks()

Javascript fallbacks are enabled by default. You can also check to see if native icu bindings can/will be used by calling the isNative() method:

var prep = new StringPrep('resourceprep')
prep.isNative()  // true or false

We also implement the ToASCII and ToUnicode operations as defined in the IDNA RFC 3490. These routines convert Unicode to ASCII with NamePrep and then with Punycode, and vice versa.

    var nodeStringPrep = require('node-stringprep');
    nodeStringPrep.toASCII('i♥u') // 'xn--iu-t0x'
    nodeStringPrep.toUnicode('xn--iu-t0x') // 'i♥u'

The operations can be finessed with an optional second argument, a set of boolean flags:

    nodeStringPrep.toASCII('i♥u', {
        allowUnassigned: true, // allow unassigned code points to be converted
        throwIfError: true, // throw exception if error, don't return string unchanged
        useSTD3Rules: true // use the STD3 ASCII rules for host names
    })
    nodeStringPrep.toUnicode('xn--iu-t0x', {
        allowUnassigned: true // allow unassigned code points to be converted
    })

Installation

    npm i node-stringprep

If libicu isn't available installation will gracefully fail and javascript fallbacks will be used.

If experiencing issues with node-gyp please see nodejs/node-gyp#363 which may be able to help.

Debian

    apt-get install libicu-dev

RedHat & Centos

    yum install libicu-devel

Gentoo

    emerge icu

OSX

MacPorts

    port install icu +devel

Boxen

    sudo ln -s /opt/boxen/homebrew/Cellar/icu4c/52.1/bin/icu-config /usr/local/bin/icu-config
    sudo ln -s /opt/boxen/homebrew/Cellar/icu4c/52.1/include/* /usr/local/include

Homebrew

brew install icu4c
ln -s /usr/local/Cellar/icu4c/<VERSION>/bin/icu-config /usr/local/bin/icu-config
ln -s /usr/local/Cellar/icu4c/<VERSION>/include/* /usr/local/include

If experiencing issues with 'homebrew' installing version 50.1 of icu4c, try the following:

    brew search icu4c
    brew tap homebrew/versions
    brew versions icu4c
    cd $(brew --prefix) && git pull --rebase
    git checkout c25fd2f $(brew --prefix)/Library/Formula/icu4c.rb
    brew install icu4c

Running Tests

npm test

node-stringprep's People

Contributors

lloydwatkin avatar astro avatar chris-rock avatar sonnyp avatar greenkeeperio-bot avatar dodo avatar c4milo avatar pixelglow avatar flecno avatar qbit avatar cedric-m avatar ewollesen avatar malditogeek avatar rvagg avatar tchollingsworth avatar lordnox avatar tomhughes avatar jscharlach avatar

Stargazers

Yasin ATEŞ avatar Michael Treanor avatar huangzhaorong avatar Josh avatar Alexandre Nicastro avatar  avatar Angus H. avatar Rick Cogley avatar Fritz Lin avatar Justin Freitag avatar Michael Anthony avatar Thibaut Patel avatar  avatar Michael Ball avatar Ken Sheedlo avatar Ivo Georgiev avatar Greg Bergé avatar Porramate Lim avatar Marek avatar  avatar  avatar Antonio Murdaca avatar Santiago Gaviria avatar  avatar tom zhou avatar  avatar puraumu avatar Andreas Botsikas avatar Scott Sanders avatar Frank Grimm avatar Shimon Doodkin avatar Jérémy Lal avatar Joohun, Maeng avatar  avatar Daniel Bartlett avatar  avatar  avatar Régis Gaidot avatar

Watchers

 avatar Neustradamus avatar  avatar James Cloos avatar Michael Anthony avatar  avatar  avatar

node-stringprep's Issues

Actual ICU errors are discarded

I was trying to use this lib to implement SASLprep, in order to support Unicode usernames. I get true for prep.isNative(), and strings can be prepared so long as ICU does not throw an error. I also disabled JS fallbacks via prep.disableJsFallbacks().

When there is a genuine error, such as a U_STRINGPREP_UNASSIGNED_ERROR, the original error is discarded, and libicu unavailable is thrown instead. The relevant source code reads:

    try {
        if (this.stringPrep) {
            return this.stringPrep.prepare(this.value)
        }
    } catch (e) {}
    if (false === this.useJsFallbacks) {
        throw new Error(this.LIBICU_NOT_AVAILABLE)
    }
    return this.jsFallback()

It would be much more useful to have the original exception. Is there some reason why the original exception is not thrown?

In addition, I think there is a much bigger problem. If you're using stringprep for something security related, the side-effects of the above code are even worse when you leave JS fallbacks enabled. In that case, even when ICU bindings are working instead of throwing the error, the code silently falls back to a potentially insecure JS substitute, and a consumer of node-stringprep might never notice this happening.

Problem building on Cygwin

npm install node-stringprep

produces:
[1/2] cxx: node-stringprep.cc -> build/default/node-stringprep_1.o
In file included from /usr/local/include/node/node.h:27,
from ../node-stringprep.cc:1:
/usr/local/include/node/v8.h:2312: warning: unused parameter name' ../node-stringprep.cc: In member functionv8::Handlev8::Value StringPrep::pre
pare(v8::String::Value&)':
../node-stringprep.cc:129: error: invalid conversion from uint16_t*' toconst
UChar_'
../node-stringprep.cc:148: error: no matching function for call to v8::String:: New(UChar_&, size_t&)' /usr/local/include/node/v8.h:1147: note: candidates are: static v8::Local<v8::St ring> v8::String::New(const char_, int) /usr/local/include/node/v8.h:1150: note: static v8::Local<v8::St ring> v8::String::New(const uint16_t_, int) <near match> ../node-stringprep.cc: In static member function static UStringPrepProfileType
StringPrep::parseProfileType(v8::String::Utf8Value&)':
../node-stringprep.cc:160: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:162: error: strcasecmp' was not declared in this scope
../node-stringprep.cc:164: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:166: error: strcasecmp' was not declared in this scope
../node-stringprep.cc:168: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:170: error: strcasecmp' was not declared in this scope
../node-stringprep.cc:172: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:174: error: strcasecmp' was not declared in this scope
../node-stringprep.cc:176: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:178: error: strcasecmp' was not declared in this scope
../node-stringprep.cc:180: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:182: error: strcasecmp' was not declared in this scope
../node-stringprep.cc:184: error:strcasecmp' was not declared in this scope ../node-stringprep.cc:186: error: strcasecmp' was not declared in this scope
Waf: Leaving directory`/home/jroberts/node/node_modules/node-stringprep/build'
Build failed: -> task failed (err #1):

libicu-devel version 4.5.1-1 is installed.

This is node v0.4.7

I have already modified eio.h to remove a couple of trailing ','s

TIA!

Error occured in Cygwin

Hi,

When i installed node-stringprep from Cygwin, I got following error:

[1/2] cxx: node-stringprep.cc -> build/default/node-stringprep_1.o
In file included from /usr/local/include/node/node.h:6,
from ../node-stringprep.cc:1:
/usr/local/include/node/eio.h:199: error: comma at end of enumerator list
In file included from /usr/local/include/node/node.h:7,
from ../node-stringprep.cc:1:
/usr/local/include/node/v8.h:2246: warning: unused parameter ‘name’
../node-stringprep.cc: In member function ‘v8::Handlev8::Value StringPrep::prepare(v8::String::Value&)’:
../node-stringprep.cc:129: error: invalid conversion from ‘uint16_t_’ to ‘const UChar_’
../node-stringprep.cc:148: error: no matching function for call to ‘v8::String::New(UChar_&, size_t&)’
/usr/local/include/node/v8.h:1147: note: candidates are: static v8::Localv8::String v8::String::New(const char_, int)
/usr/local/include/node/v8.h:1150: note: static v8::Localv8::String v8::String::New(const uint16_t*, i
nt)
../node-stringprep.cc: In static member function ‘static UStringPrepProfileType StringPrep::parseProfileType(v8::String
::Utf8Value&)’:
../node-stringprep.cc:160: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:162: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:164: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:166: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:168: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:170: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:172: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:174: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:176: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:178: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:180: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:182: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:184: error: ‘strcasecmp’ was not declared in this scope
../node-stringprep.cc:186: error: ‘strcasecmp’ was not declared in this scope
Waf: Leaving directory `/home/Administrator/installations/node-stringprep/build'
Build failed: -> task failed (err #1):
{task: cxx node-stringprep.cc -> node-stringprep_1.o}

Administrator@mynetbook ~/installations/node-stringprep

Does anybody have clue about this?

Many thanks,

Problem Building on OSX 10.6.7

Hi, I'm trying to install via NPM on OS X and got an error:

npm install node-stringprep

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preinstall [email protected]
npm info install [email protected]
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : ok /Users/josser/.node_libraries
Checking for node prefix : ok /usr/local
'configure' finished successfully (0.109s)
Waf: Entering directory /Users/josser/.node/lib/.npm/node-stringprep/0.0.3/package/build' [1/2] cxx: node-stringprep.cc -> build/default/node-stringprep_1.o In file included from /usr/local/include/node/node.h:26, from ../node-stringprep.cc:1: /usr/local/include/node/eio.h:179: error: comma at end of enumerator list /usr/local/include/node/eio.h:187: error: comma at end of enumerator list In file included from /usr/local/include/node/node.h:27, from ../node-stringprep.cc:1: /usr/local/include/node/v8.h:2312: warning: unused parameter ‘name’ Waf: Leaving directory/Users/josser/.node/lib/.npm/node-stringprep/0.0.3/package/build'
Build failed: -> task failed (err #1):
{task: cxx node-stringprep.cc -> node-stringprep_1.o}
npm info [email protected] Failed to exec install script
npm ERR! install failed Error: [email protected] install: ./install.sh
npm ERR! install failed sh "-c" "./install.sh" failed with 1
npm ERR! install failed at ChildProcess. (/Users/josser/.node/lib/.npm/npm/0.3.18/package/lib/utils/exec.js:49:20)
npm ERR! install failed at ChildProcess.emit (events.js:67:17)
npm ERR! install failed at ChildProcess.onexit (child_process.js:192:12)
npm info install failed rollback
npm info uninstall [ '[email protected]' ]
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info auto-deactive not symlink
npm info postuninstall [email protected]
npm info uninstall [email protected] complete
npm info install failed rolled back
npm ERR! Error: [email protected] install: ./install.sh
npm ERR! sh "-c" "./install.sh" failed with 1
npm ERR! at ChildProcess. (/Users/josser/.node/lib/.npm/npm/0.3.18/package/lib/utils/exec.js:49:20)
npm ERR! at ChildProcess.emit (events.js:67:17)
npm ERR! at ChildProcess.onexit (child_process.js:192:12)
npm ERR!
npm ERR! Failed at the [email protected] 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! ./install.sh
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 Darwin 10.7.0
npm ERR! argv { remain: [ 'node-stringprep' ],
npm ERR! argv cooked: [ 'install', 'node-stringprep' ],
npm ERR! argv original: [ 'install', 'node-stringprep' ] }
npm not ok

icu version: 4.8

Hope it's help!
Thanks and sorry for bad english.

'icu-config' not set when requiring node-stringprep on Heroku

When trying to require node-stringprep it blows up because 'icu-config' is not set. Is there any way to make this library compatible with Heroku?

Below is the error

-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.6.18
Using npm version: 1.0.106
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm

   > [email protected] install /tmp/build_16kbn7s6d475y/node_modules/node-stringprep
   > sh ./install.sh

   Cannot find `icu-config` in $PATH,
   please install it from http://site.icu-project.org/
   npm ERR! error installing [email protected] Error: [email protected] install: `sh ./install.sh`
   npm ERR! error installing [email protected] `sh "-c" "sh ./install.sh"` failed with 1
   npm ERR! error installing [email protected]     at ChildProcess.<anonymous> (/tmp/node-npm-6dNs/lib/utils/exec.js:49:20)
   npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:70:17)
   npm ERR! error installing [email protected]     at maybeExit (child_process.js:362:16)
   npm ERR! error installing [email protected]     at Process.onexit (child_process.js:398:5)
   npm ERR! [email protected] install: `sh ./install.sh`
   npm ERR! `sh "-c" "sh ./install.sh"` failed with 1
   npm ERR! 
   npm ERR! Failed at the [email protected] 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!     sh ./install.sh
   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! 
   npm ERR! System Linux 2.6.32-343-ec2
   npm ERR! command "/tmp/node-node-Mtpb/bin/node" "/tmp/node-npm-6dNs/cli.js" "install" "--production"
   npm ERR! cwd /tmp/build_16kbn7s6d475y
   npm ERR! node -v v0.6.18
   npm ERR! npm -v 1.0.106
   npm ERR! code ELIFECYCLE
   npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url']
   npm ERR! 
   npm ERR! Additional logging details can be found in:
   npm ERR!     /tmp/build_16kbn7s6d475y/npm-debug.log
   npm not ok

! Failed to install --production dependencies with npm
! Heroku push rejected, failed to compile Node.js app

This library is a requirement for the Hubot-Gtalk adapter and this error is currently preventing me from deploying to Heroku.

Thanks.

Fails for io.js 3.2.0

Tried to install it for the recent io.js - fails.

Modifying nan in package.json to latest didn't help.
Providing the log.

~/node-stringprep
iliakan> npm i
npm WARN package.json [email protected] No license field.
npm http request GET https://registry.npmjs.org/bindings
npm http request GET https://registry.npmjs.org/debug
npm http request GET https://registry.npmjs.org/nan
npm http request GET https://registry.npmjs.org/grunt-cli
npm http request GET https://registry.npmjs.org/grunt
npm http request GET https://registry.npmjs.org/grunt-contrib-jshint
npm http request GET https://registry.npmjs.org/grunt-mocha-cli
npm http request GET https://registry.npmjs.org/proxyquire
npm http request GET https://registry.npmjs.org/should
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/grunt-cli
npm http 304 https://registry.npmjs.org/should
npm http 304 https://registry.npmjs.org/proxyquire
npm http 304 https://registry.npmjs.org/grunt-contrib-jshint
npm http 304 https://registry.npmjs.org/grunt
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/grunt-mocha-cli
npm WARN engine [email protected]: wanted: {"node":"~0.10.0 || ~0.8.0"} (current: {"node":"3.2.0","npm":"2.13.3"})
npm http request GET https://registry.npmjs.org/ms
npm http request GET https://registry.npmjs.org/nopt
npm http request GET https://registry.npmjs.org/findup-sync
npm http request GET https://registry.npmjs.org/resolve
npm http request GET https://registry.npmjs.org/jshint
npm http request GET https://registry.npmjs.org/coffee-script
npm http request GET https://registry.npmjs.org/colors
npm http request GET https://registry.npmjs.org/mocha
npm http request GET https://registry.npmjs.org/glob
npm http request GET https://registry.npmjs.org/dateformat
npm http request GET https://registry.npmjs.org/hooker
npm http request GET https://registry.npmjs.org/minimatch
npm http request GET https://registry.npmjs.org/eventemitter2
npm http request GET https://registry.npmjs.org/lodash
npm http request GET https://registry.npmjs.org/async
npm http request GET https://registry.npmjs.org/underscore.string
npm http request GET https://registry.npmjs.org/iconv-lite
npm http request GET https://registry.npmjs.org/rimraf
npm http request GET https://registry.npmjs.org/which
npm http request GET https://registry.npmjs.org/exit
npm http request GET https://registry.npmjs.org/js-yaml
npm http request GET https://registry.npmjs.org/getobject
npm http request GET https://registry.npmjs.org/grunt-legacy-util
npm http request GET https://registry.npmjs.org/grunt-legacy-log
npm http 304 https://registry.npmjs.org/ms
npm http 304 https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/jshint
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/eventemitter2
npm http 304 https://registry.npmjs.org/hooker
npm http 304 https://registry.npmjs.org/dateformat
npm http 304 https://registry.npmjs.org/getobject
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/grunt-legacy-log
npm http 304 https://registry.npmjs.org/exit
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/grunt-legacy-util
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/resolve
npm http request GET https://registry.npmjs.org/abbrev
npm http request GET https://registry.npmjs.org/grunt-legacy-log-utils
npm http 304 https://registry.npmjs.org/abbrev
npm http request GET https://registry.npmjs.org/lru-cache
npm http request GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/grunt-legacy-log-utils
npm http request GET https://registry.npmjs.org/graceful-fs
npm http request GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/inherits
npm http request GET https://registry.npmjs.org/argparse
npm http request GET https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/argparse
npm http request GET https://registry.npmjs.org/commander
npm http request GET https://registry.npmjs.org/growl
npm http request GET https://registry.npmjs.org/jade
npm http request GET https://registry.npmjs.org/diff
npm http request GET https://registry.npmjs.org/mkdirp
npm http request GET https://registry.npmjs.org/shelljs
npm http request GET https://registry.npmjs.org/underscore
npm http request GET https://registry.npmjs.org/cli
npm http request GET https://registry.npmjs.org/console-browserify
npm http 304 https://registry.npmjs.org/jade
npm http 304 https://registry.npmjs.org/growl
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/diff
npm http 304 https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/cli
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/console-browserify
npm http request GET https://registry.npmjs.org/inflight
npm http request GET https://registry.npmjs.org/once
npm http request GET https://registry.npmjs.org/path-is-absolute
npm WARN prefer global [email protected] should be installed with -g
npm http 304 https://registry.npmjs.org/once
npm http 304 https://registry.npmjs.org/inflight
npm http 304 https://registry.npmjs.org/path-is-absolute
npm http request GET https://registry.npmjs.org/wrappy
npm http request GET https://registry.npmjs.org/brace-expansion
npm http 304 https://registry.npmjs.org/wrappy
npm http 304 https://registry.npmjs.org/brace-expansion
npm http request GET https://registry.npmjs.org/balanced-match
npm http request GET https://registry.npmjs.org/concat-map
npm http 304 https://registry.npmjs.org/concat-map
npm http 304 https://registry.npmjs.org/balanced-match

> [email protected] install /Users/iliakan/node-stringprep
> node-gyp rebuild

  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
../node-stringprep.cc:22:5: error: use of undeclared identifier 'NanScope'
    NanScope();
    ^
../node-stringprep.cc:23:33: error: use of undeclared identifier 'NanNew'
    Local<FunctionTemplate> t = NanNew<FunctionTemplate>(New);
                                ^
../node-stringprep.cc:23:40: error: 'FunctionTemplate' does not refer to a value
    Local<FunctionTemplate> t = NanNew<FunctionTemplate>(New);
                                       ^
/Users/iliakan/.node-gyp/3.2.0/include/node/v8.h:4108:17: note: declared here
class V8_EXPORT FunctionTemplate : public Template {
                ^
../node-stringprep.cc:24:5: error: use of undeclared identifier 'NanAssignPersistent'
    NanAssignPersistent(stringprep_constructor, t);
    ^
../node-stringprep.cc:26:45: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void (*)(const FunctionCallbackInfo<v8::Value> &)') with an lvalue of type
      'Nan::NAN_METHOD_RETURN_TYPE (Nan::NAN_METHOD_ARGS_TYPE)': type mismatch at 1st parameter ('const FunctionCallbackInfo<v8::Value> &'
      (aka 'const v8::FunctionCallbackInfo<v8::Value> &') vs 'Nan::NAN_METHOD_ARGS_TYPE' (aka 'const FunctionCallbackInfo<v8::Value> &'))
    NODE_SET_PROTOTYPE_METHOD(t, "prepare", Prepare);
                                            ^~~~~~~
/Users/iliakan/.node-gyp/3.2.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
                                      v8::FunctionCallback callback) {
                                                           ^
../node-stringprep.cc:28:17: error: use of undeclared identifier 'NanNew'
    target->Set(NanNew<String>("StringPrep"), t->GetFunction());
                ^
../node-stringprep.cc:28:24: error: 'String' does not refer to a value
    target->Set(NanNew<String>("StringPrep"), t->GetFunction());
                       ^
/Users/iliakan/.node-gyp/3.2.0/include/node/v8.h:2028:17: note: declared here
class V8_EXPORT String : public Name {
                ^
../node-stringprep.cc:46:5: error: use of undeclared identifier 'NanScope'
    NanScope();
    ^
../node-stringprep.cc:48:9: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
    if (args.Length() >= 1 && args[0]->IsString())
        ^~~~
        uv_process_options_s::args
/Users/iliakan/.node-gyp/3.2.0/include/node/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../node-stringprep.cc:48:9: error: invalid use of member 'args' in static member function
    if (args.Length() >= 1 && args[0]->IsString())
        ^~~~
../node-stringprep.cc:48:31: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
    if (args.Length() >= 1 && args[0]->IsString())
                              ^~~~
                              uv_process_options_s::args
/Users/iliakan/.node-gyp/3.2.0/include/node/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../node-stringprep.cc:48:31: error: invalid use of member 'args' in static member function
    if (args.Length() >= 1 && args[0]->IsString())
                              ^~~~
../node-stringprep.cc:50:32: error: use of undeclared identifier 'args'; did you mean 'uv_process_options_s::args'?
        String::Utf8Value arg0(args[0]->ToString());
                               ^~~~
                               uv_process_options_s::args
/Users/iliakan/.node-gyp/3.2.0/include/node/uv.h:857:10: note: 'uv_process_options_s::args' declared here
  char** args;
         ^
../node-stringprep.cc:50:32: error: invalid use of member 'args' in static member function
        String::Utf8Value arg0(args[0]->ToString());
                               ^~~~
../node-stringprep.cc:58:13: error: use of undeclared identifier 'NanThrowTypeError'; did you mean 'Nan::ThrowTypeError'?
            NanThrowTypeError("Unknown StringPrep profile");
            ^~~~~~~~~~~~~~~~~
            Nan::ThrowTypeError
../node_modules/nan/nan.h:643:3: note: 'Nan::ThrowTypeError' declared here
  X(TypeError)
  ^
../node_modules/nan/nan.h:627:21: note: expanded from macro 'X'
    NAN_INLINE void Throw ## NAME(const char *msg) {                           \
                    ^
<scratch space>:116:1: note: expanded from here
ThrowTypeError
^
../node-stringprep.cc:59:13: error: use of undeclared identifier 'NanReturnUndefined'
            NanReturnUndefined();
            ^
../node-stringprep.cc:65:24: error: use of undeclared identifier 'args'; did you mean 'arg0'?
            self->Wrap(args.This());
                       ^~~~
                       arg0
../node-stringprep.cc:50:27: note: 'arg0' declared here
        String::Utf8Value arg0(args[0]->ToString());
                          ^
../node-stringprep.cc:65:29: error: no member named 'This' in 'v8::String::Utf8Value'
            self->Wrap(args.This());
                       ~~~~ ^
../node-stringprep.cc:66:28: error: use of undeclared identifier 'args'; did you mean 'arg0'?
            NanReturnValue(args.This());
                           ^~~~
                           arg0
../node-stringprep.cc:50:27: note: 'arg0' declared here
        String::Utf8Value arg0(args[0]->ToString());
                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/node_stringprep/node-stringprep.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "/usr/local/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/iliakan/node-stringprep
gyp ERR! node -v v3.2.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok

npm ERR! Darwin 14.4.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "i"
npm ERR! node v3.2.0
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     /Users/iliakan/node-stringprep/npm-debug.log

No longer builds

Not sure, but it seems like something changed in the Nan module that affects node-stringpreps ability to install correctly:

$ ls
$ node --version
v4.2.1
$ rm -rf $HOME/.node-gyp
$ npm install node-stringprep
-
> [email protected] install /home/robert/BlimBlam/node_modules/node-stringprep
> node-gyp rebuild

make: Entering directory `/home/robert/BlimBlam/node_modules/node-stringprep/build'
  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
In file included from ../node-stringprep.cc:1:0:
../node_modules/nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../node_modules/nan/nan.h:256:25: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../node-stringprep.cc:1:
/home/robert/.node-gyp/4.2.1/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/robert/.node-gyp/4.2.1/include/node/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/robert/.node-gyp/4.2.1/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/robert/.node-gyp/4.2.1/include/node/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../node-stringprep.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/node_stringprep/node-stringprep.o] Error 1
make: Leaving directory `/home/robert/BlimBlam/node_modules/node-stringprep/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/media/data/software/node-v4.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.13.0-61-generic
gyp ERR! command "/media/data/software/node-v4.2.1/bin/node" "/media/data/software/node-v4.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/robert/BlimBlam/node_modules/node-stringprep
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 3.13.0-61-generic
npm ERR! argv "/media/data/software/node-v4.2.1/bin/node" "/media/data/software/node/bin/npm" "install" "node-stringprep"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     /home/robert/BlimBlam/npm-debug.log

Installation fails on Debian Lenny

This is the output of npm install node-stringprep. I get the same output when cloning git repo and running ./install.sh ... libicu-dev is installed (libicu-dev_3.8.1-3+lenny2_amd64.deb).

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /root/.node_libraries 
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.041s)
Waf: Entering directory `/usr/local/lib/node/.npm/node-stringprep/0.0.2/package/build'
[1/2] cxx: node-stringprep.cc -> build/default/node-stringprep_1.o
../node-stringprep.cc:89: error: expected ‘,’ or ‘...’ before ‘profileType’
../node-stringprep.cc:89: error: ISO C++ forbids declaration of ‘UStringPrepProfileType’ with no type
../node-stringprep.cc:157: error: use of enum ‘UStringPrepProfileType’ without previous declaration
../node-stringprep.cc: In static member function ‘static v8::Handle<v8::Value> StringPrep::New(const v8::Arguments&)’:
../node-stringprep.cc:62: error: ‘UStringPrepProfileType’ was not declared in this scope
../node-stringprep.cc:62: error: expected `;' before ‘profileType’
../node-stringprep.cc:65: error: ‘profileType’ was not declared in this scope
../node-stringprep.cc:72: error: ‘profileType’ was not declared in this scope
../node-stringprep.cc: In constructor ‘StringPrep::StringPrep(int)’:
../node-stringprep.cc:92: error: ‘profileType’ was not declared in this scope
../node-stringprep.cc:92: error: ‘usprep_openByType’ was not declared in this scope
../node-stringprep.cc: In static member function ‘static int StringPrep::parseProfileType(v8::String::Utf8Value&)’:
../node-stringprep.cc:161: error: ‘USPREP_RFC3491_NAMEPREP’ was not declared in this scope
../node-stringprep.cc:163: error: ‘USPREP_RFC3530_NFS4_CS_PREP’ was not declared in this scope
../node-stringprep.cc:165: error: ‘USPREP_RFC3530_NFS4_CS_PREP_CI’ was not declared in this scope
../node-stringprep.cc:167: error: ‘USPREP_RFC3530_NFS4_CIS_PREP’ was not declared in this scope
../node-stringprep.cc:169: error: ‘USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX’ was not declared in this scope
../node-stringprep.cc:171: error: ‘USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX’ was not declared in this scope
../node-stringprep.cc:173: error: ‘USPREP_RFC3722_ISCSI’ was not declared in this scope
../node-stringprep.cc:175: error: ‘USPREP_RFC3920_NODEPREP’ was not declared in this scope
../node-stringprep.cc:177: error: ‘USPREP_RFC3920_RESOURCEPREP’ was not declared in this scope
../node-stringprep.cc:179: error: ‘USPREP_RFC4011_MIB’ was not declared in this scope
../node-stringprep.cc:181: error: ‘USPREP_RFC4013_SASLPREP’ was not declared in this scope
../node-stringprep.cc:183: error: ‘USPREP_RFC4505_TRACE’ was not declared in this scope
../node-stringprep.cc:185: error: ‘USPREP_RFC4518_LDAP’ was not declared in this scope
../node-stringprep.cc:187: error: ‘USPREP_RFC4518_LDAP_CI’ was not declared in this scope
Waf: Leaving directory `/usr/local/lib/node/.npm/node-stringprep/0.0.2/package/build'
Build failed:  -> task failed (err #1): 
    {task: cxx node-stringprep.cc -> node-stringprep_1.o}
npm info [email protected] Failed to exec install script
npm ERR! install failed Error: [email protected] install: `./install.sh`
npm ERR! install failed `sh` failed with 1
npm ERR! install failed     at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.2.16/package/lib/utils/exec.js:25:18)
npm ERR! install failed     at ChildProcess.emit (events.js:45:17)
npm ERR! install failed     at ChildProcess.onexit (child_process.js:165:12)
npm info install failed rollback
npm info uninstall [ '[email protected]' ]
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info auto-deactive not symlink
npm info postuninstall [email protected]
npm info uninstall [email protected] complete
npm info install failed rolled back
npm ERR! Error: [email protected] install: `./install.sh`
npm ERR! `sh` failed with 1
npm ERR!     at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.2.16/package/lib/utils/exec.js:25:18)
npm ERR!     at ChildProcess.emit (events.js:45:17)
npm ERR!     at ChildProcess.onexit (child_process.js:165:12)
npm ERR! 
npm ERR! Failed at the [email protected] 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!     ./install.sh
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-stringprep
npm ERR! There may be additional logging output above.

cpp -v

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-3' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-3) 
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic'
 /usr/lib/gcc/x86_64-linux-gnu/4.4.5/cc1 -E -quiet -v - -mtune=generic
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include
 /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed
 /usr/include
End of search list.

[email protected] fatal error C1083:

..\node-stringprep.cc(3): fatal error C1083: Cannot open include file: 'unicode
/unistr.h': No such file or directory [C:\work\svn\jsim\node\realTime\node_modu
les\node-stringprep\build\node-stringprep.vcxproj]

I'm getting the above error when running npm install on windows.
npm ERR! node-gyp rebuild
gyp ERR! node-gyp -v v0.6.11
npm ERR! node -v v0.8.11
npm ERR! npm -v 1.1.62
npm ERR! System Windows_NT 6.2.9200

I can post the debug log if needed

Include libicu-dev in the build

npm install should be enough to install node-stringprep. The user shouldn't have to do a bunch of other crap to get this to install - thats the whole point of a package management system like npm.

I think you can probably just put an appropriate preinstall script in package.json that checks what kind of linux you have and runs the right stuff to install libicu.

Problem binding on Mac OS X

Hey, I brew install icu4ced and followed the linking instruction on Mac OS X, yet, I'm unable to run it:

dyld: lazy symbol binding failed: Symbol not found: _usprep_openByType_4_2
  Referenced from: /Users/julien/repos/supernoder/node_modules/node-xmpp/node_modules/node-xmpp-core/node_modules/node-stringprep/build/Release/node_stringprep.node
  Expected in: dynamic lookup

dyld: Symbol not found: _usprep_openByType_4_2
  Referenced from: /Users/julien/repos/supernoder/node_modules/node-xmpp/node_modules/node-xmpp-core/node_modules/node-stringprep/build/Release/node_stringprep.node
  Expected in: dynamic lookup

Trace/BPT trap: 5

Readme correction

For the homebrew icu4c linking, you have stated:
ln -s /usr/local/Cellar/icu4c//include /usr/local/include

but you should probably have the source reference all the files in the include folder instead, like this:

ln -s /usr/local/Cellar/icu4c//include/* /usr/local/include

My install was not working until I made this change.

unable to install on centos 5.2

01:node-xmpp jhuttner$ npm install node-stringprep

[email protected] install /home/jhuttner/git-repos/node-xmpp/node_modules/node-stringprep
./install.sh

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : ok /home/jhuttner/.node_libraries
Checking for node prefix : ok /usr/local
/home/jhuttner/git-repos/node-xmpp/node_modules/node-stringprep/wscript:17: error: Missing library icu 4.x.x
npm ERR! error installing [email protected] Error: [email protected] install: ./install.sh
npm ERR! error installing [email protected] sh "-c" "./install.sh" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] install: ./install.sh
npm ERR! sh "-c" "./install.sh" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] 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! ./install.sh
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!
npm ERR! System Linux 2.6.18-128.7.1.el5xen
npm ERR! command "node" "/usr/local/bin/npm" "install" "node-stringprep"
npm ERR! cwd /home/jhuttner/git-repos/node-xmpp
npm ERR! node -v v0.4.12
npm ERR! npm -v 1.0.104
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/jhuttner/git-repos/node-xmpp/npm-debug.log
npm not ok

node-gyp rebuild fails for 0.2.3

CentOS 6.3
node 0.10.24
npm 1.3.21
node-gyp 0.12.2

I can reproduce via "npm install [email protected]" anywhere on my system,
tried to attach log but only images are supported, see interesting part of output below
Thanks,
Seth

gyp: Call to 'which icu-config > /dev/null || echo n' returned exit status 0.
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/scarter/Projects/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 2.6.32-431.el6.x86_64
gyp ERR! command "node" "/home/scarter/Projects/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/scarter/Projects/local/lib/node_modules/node-stringprep
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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 2.6.32-431.el6.x86_64
npm ERR! command "/home/scarter/Projects/local/bin/node" "/home/scarter/Projects/local/bin/npm" "i" "-g" "node-stringprep"
npm ERR! cwd /home/scarter/Projects/local/bin
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/scarter/Projects/local/bin/npm-debug.log
npm ERR! not ok code 0

Error: Symbol node_stringprep_module not found.

I followed the instructions for OS X:

brew install icu4c
ln -s /usr/local/Cellar/icu4c/51.1/include/unicode /usr/local/include
ln -s /usr/local/Cellar/icu4c/51.1/bin/icu-config /usr/local/bin/icu-config
npm install node-stringprep

But still I get the "Symbol node_stringprep_module not found" error as in issue #27. I have node v0.10.5.

(I also tried rebuilding node-stringprep after linking to icu4c/49.1.2 as I see there is some vague issue with recent versions?)

does not compile on OSX

when i try npm install node-stringprep on snow leopard i get the following error:

Build failed:  -> task failed (err # 1): 
{task: cxx node-stringprep.cc -> node-stringprep_1.o}

Any tips on how i get this to run?

Unable to install node-xmpp

Well, i feel to much tired now that i have to file a bug that raises the following issue:
When installing node-xmpp on my Windows 7 platform i am getting the following error:

[email protected] install E:\repository\testnodexmpp\node_modules\node-str
ingprep
node-gyp rebuild

E:\repository\testnodexmpp\node_modules\node-stringprep>node "C:\Program Files\n
odejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gy
p.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
E:\repository\testnodexmpp\node_modules\node-stringprep\build\node_stringprep.v
cxproj(18,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.pro
ps" was not found. Confirm that the path in the declaration is correct
, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:807:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd E:\repository\testnodexmpp\node_modules\node-stringprep
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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 Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd E:\repository\testnodexmpp
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! E:\repository\testnodexmpp\npm-debug.log
npm ERR! not ok code 0

Earlier i was getting the error that i don't have VCBuild.exe so it turned out that i need VS2010, so now i have VS2010 but after that i got the error mentioned above. It seems to be the issue of node-stringprep to me.

Any resolution/work-around will be highly appreciated.

Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'

Hi guys,

Not sure if it's alright to post this here.

I deployed node-xmpp. No error messages during installation. But when I tried running a script, it prompted me to go install StringPrep.

Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'

As prompted, I npm install node-stringprep, and I got the following errors.

[root@ip-10-128-45-253 examples]# npm install node-stringprep
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm http GET https://registry.npmjs.org/node-stringprep
npm http 304 https://registry.npmjs.org/node-stringprep

[email protected] install /home/ec2-user/www/node_modules/node-xmpp/node_modules/node-stringprep
node-gyp rebuild

make: Entering directory /home/ec2-user/www/node_modules/node-xmpp/node_modules/node-stringprep/build' CXX(target) Release/obj.target/node-stringprep/node-stringprep.o ../node-stringprep.cc:3:28: fatal error: unicode/unistr.h: No such file or directory compilation terminated. make: *** [Release/obj.target/node-stringprep/node-stringprep.o] Error 1 make: Leaving directory/home/ec2-user/www/node_modules/node-xmpp/node_modules/node-stringprep/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.4.43-43.43.amzn1.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ec2-user/www/node_modules/node-xmpp/node_modules/node-stringprep
gyp ERR! node -v v0.10.8
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

howto build with icu installed locally

on target machine i have only user right and can install icu only in local dirs

the first line of error log are

npm http GET https://registry.npmjs.org/node-stringprep
npm http 304 https://registry.npmjs.org/node-stringprep
../node-stringprep.cc:3:28: warning: unicode/unistr.h: No such file or directory
../node-stringprep.cc:4:28: warning: unicode/usprep.h: No such file or directory
../node-stringprep.cc:5:27: warning: unicode/uidna.h: No such file or directory

but if i run
$ icu-config --version
49.1.2

i mean i have all to build lib but cannot

Can you give detail instruction to build in my situation?

Thx.

Another failed install

Maybe it only builds in certain flavours of unix ?

$ brew install icu4c
Warning: Your Xcode (4.6.2) is outdated
Please install Xcode 4.6.3.
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/icu4c-51.1.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring icu4c-51.1.mountain_lion.bottle.tar.gz
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Conflicts; see: https://github.com/mxcl/homebrew/issues/issue/167

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/icu4c/lib
    CPPFLAGS: -I/usr/local/opt/icu4c/include

==> Summary
  /usr/local/Cellar/icu4c/51.1: 235 files, 58M
$ npm i node-stringprep
npm http GET https://registry.npmjs.org/node-stringprep
npm http 304 https://registry.npmjs.org/node-stringprep

> [email protected] install /Users/jpillora/Code/Node/node-logbook/node_modules/node-stringprep
> node-gyp rebuild

  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
../node-stringprep.cc:3:10: fatal error: 'unicode/unistr.h' file not found
#include <unicode/unistr.h>
         ^
1 error generated.
make: *** [Release/obj.target/node_stringprep/node-stringprep.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Darwin 12.4.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jpillora/Code/Node/node-logbook/node_modules/node-stringprep
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] 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 Darwin 12.4.0
npm ERR! command "/usr/local/Cellar/node/0.10.5/bin/node" "/usr/local/bin/npm" "i" "node-stringprep"
npm ERR! cwd /Users/jpillora/Code/Node/node-logbook
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/jpillora/Code/Node/node-logbook/npm-debug.log
npm ERR! not ok code 0

Can't install hubot-hipchat, and it points at node-stringprep

Hi - I'm trying to run npm install --save hubot-hipchat to add the hipchat adapter to my hubot. This part of stdout:

npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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

... implies it's a problem with node-stringprep. Please see what I think are the relevant logs in this gist:

https://gist.github.com/RickCogley/53b601d60dc7e509bc79

A little about my environment:

Shared server at Webfaction
CentOS release 6.7 (Final) (x86_64 GNU/Linux)
gcc v4.8.1
node v4.0.0
npm v3.3.9
used npm config to set python = "/usr/local/bin/python2.7"
exported env var PYTHON=python2.7

I hope that is enough info. Could someone please take a look?

Kind regards,
Rick

nextTick will break in next version of node

When running the leakcheck.js test I get the following error on node 0.9.5:

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

what is wrong? - npm i node-stringprep

0 info it worked if it ends with ok
1 verbose cli [ '/home/user/bin/node',
1 verbose cli '/home/user/bin/npm',
1 verbose cli 'i',
1 verbose cli 'node-stringprep' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /home/user/project/package.json
5 verbose read json /home/user/project/node_modules/ws/package.json
6 verbose read json /home/user/project/node_modules/node-xmpp/package.json
7 verbose read json /home/user/project/node_modules/log4js/package.json
8 verbose read json /home/user/project/node_modules/express/package.json
9 verbose read json /home/user/project/node_modules/simplesets/package.json
10 verbose read json /home/user/project/node_modules/config/package.json
11 verbose read json /home/user/project/package.json
12 verbose cache add [ 'node-stringprep', null ]
13 silly cache add name=undefined spec="node-stringprep" args=["node-stringprep",null]
14 verbose parsed url { pathname: 'node-stringprep',
14 verbose parsed url path: 'node-stringprep',
14 verbose parsed url href: 'node-stringprep' }
15 silly lockFile d7e52d33-node-stringprep node-stringprep
16 verbose lock node-stringprep /home/user/.npm/d7e52d33-node-stringprep.lock
17 silly lockFile d7e52d33-node-stringprep node-stringprep
18 verbose addNamed [ 'node-stringprep', '' ]
19 verbose addNamed [ null, '' ]
20 silly lockFile c469c25e-node-stringprep node-stringprep@
21 verbose lock node-stringprep@ /home/user/.npm/c469c25e-node-stringprep.lock
22 silly addNameRange { name: 'node-stringprep', range: '', hasData: false }
23 verbose url raw node-stringprep
24 verbose url resolving [ 'https://registry.npmjs.org/', './node-stringprep' ]
25 verbose url resolved https://registry.npmjs.org/node-stringprep
26 info retry registry request attempt 1 at 12:30:58
27 verbose etag "EPLIPACCQRATL35PD7ULU7JIR"
28 http GET https://registry.npmjs.org/node-stringprep
29 http 304 https://registry.npmjs.org/node-stringprep
30 silly registry.get cb [ 304,
30 silly registry.get { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
30 silly registry.get etag: '"EPLIPACCQRATL35PD7ULU7JIR"',
30 silly registry.get date: 'Tue, 21 Aug 2012 09:31:14 GMT',
30 silly registry.get 'content-length': '0' } ]
31 verbose etag node-stringprep from cache
32 silly addNameRange number 2 { name: 'node-stringprep', range: '', hasData: true }
33 silly addNameRange versions [ 'node-stringprep',
33 silly addNameRange [ '0.0.2',
33 silly addNameRange '0.0.3',
33 silly addNameRange '0.0.4',
33 silly addNameRange '0.0.5',
33 silly addNameRange '0.1.0',
33 silly addNameRange '0.1.1',
33 silly addNameRange '0.1.2',
33 silly addNameRange '0.1.3',
33 silly addNameRange '0.1.4',
33 silly addNameRange '0.1.5' ] ]
34 verbose addNamed [ 'node-stringprep', '0.1.5' ]
35 verbose addNamed [ '0.1.5', '0.1.5' ]
36 silly lockFile 536bbb1d-node-stringprep-0-1-5 [email protected]
37 verbose lock [email protected] /home/user/.npm/536bbb1d-node-stringprep-0-1-5.lock
38 verbose read json /home/user/.npm/node-stringprep/0.1.5/package/package.json
39 silly lockFile 536bbb1d-node-stringprep-0-1-5 [email protected]
40 silly lockFile c469c25e-node-stringprep node-stringprep@
41 silly resolved [ { name: 'node-stringprep',
41 silly resolved version: '0.1.5',
41 silly resolved main: './build/Release/node-stringprep.node',
41 silly resolved description: 'ICU StringPrep profiles',
41 silly resolved keywords: [ 'unicode', 'stringprep', 'icu' ],
41 silly resolved dependencies: {},
41 silly resolved devDependencies: {},
41 silly resolved repository:
41 silly resolved { type: 'git',
41 silly resolved path: 'git://github.com/astro/node-stringprep.git' },
41 silly resolved homepage: 'http://github.com/astro/node-stringprep',
41 silly resolved bugs: 'http://github.com/astro/node-stringprep/issues',
41 silly resolved author:
41 silly resolved { name: 'Astro',
41 silly resolved email: '[email protected]',
41 silly resolved url: 'http://spaceboyz.net/~astro/' },
41 silly resolved licenses: [ [Object] ],
41 silly resolved engines: { node: '>=0.4' },
41 silly resolved scripts: { install: 'node-gyp rebuild' },
41 silly resolved gypfile: true,
41 silly resolved readme: '# node-stringprep #\n\nFlattr this!\n\n## Purpose ##\n\nExposes predefined Unicode normalization functions that are required by many protocols. This is just a binding to ICU, which is said to be fast.\n\n## Installation ##\n\n # Debian\n apt-get install libicu-dev\n\n # Gentoo\n emerge icu\n\n # OSX using MacPorts\n port install icu +devel\n\n # OSX using Homebrew\n brew install icu4c\n ln -s /usr/local/Cellar/icu4c//bin/icu-config /usr/local/bin/icu-config\n\n npm install node-stringprep\n\n## Usage ##\n\n var StringPrep = require('node-stringprep').StringPrep;\n var prep = new StringPrep('nameprep');\n prep.prepare('├Дffchen') // => '├дffchen'\n\nFor a list of supported profiles, see node-stringprep.cc\n',
41 silly resolved _id: '[email protected]',
41 silly resolved _from: 'node-stringprep' } ]
42 info install [email protected] into /home/user/project
43 info installOne [email protected]
44 verbose from cache /home/user/.npm/node-stringprep/0.1.5/package/package.json
45 info /home/user/project/node_modules/node-stringprep unbuild
46 verbose read json /home/user/project/node_modules/node-stringprep/package.json
47 verbose tar unpack /home/user/.npm/node-stringprep/0.1.5/package.tgz
48 silly lockFile 07b23063-ers-node-modules-node-stringprep /home/user/project/node_modules/node-stringprep
49 verbose lock /home/user/project/node_modules/node-stringprep /home/user/.npm/07b23063-ers-node-modules-node-stringprep.lock
50 silly gunzTarPerm modes [ '777', '666' ]
51 silly gunzTarPerm extractEntry package.json
52 silly gunzTarPerm extractEntry .npmignore
53 silly gunzTarPerm extractEntry LICENSE
54 silly gunzTarPerm extractEntry leakcheck.js
55 silly gunzTarPerm extractEntry install.sh
56 silly gunzTarPerm extractEntry README.markdown
57 silly gunzTarPerm extractEntry node-stringprep.cc
58 silly gunzTarPerm extractEntry wscript
59 silly gunzTarPerm extractEntry binding.gyp
60 verbose read json /home/user/project/node_modules/node-stringprep/package.json
61 silly lockFile 07b23063-ers-node-modules-node-stringprep /home/user/project/node_modules/node-stringprep
62 info preinstall [email protected]
63 verbose from cache /home/user/project/node_modules/node-stringprep/package.json
64 verbose readDependencies using package.json deps
65 verbose from cache /home/user/project/node_modules/node-stringprep/package.json
66 verbose readDependencies using package.json deps
67 silly resolved []
68 verbose about to build /home/user/project/node_modules/node-stringprep
69 info build /home/user/project/node_modules/node-stringprep
70 verbose from cache /home/user/project/node_modules/node-stringprep/package.json
71 verbose linkStuff [ false,
71 verbose linkStuff false,
71 verbose linkStuff false,
71 verbose linkStuff '/home/user/project/node_modules' ]
72 info linkStuff [email protected]
73 verbose linkBins [email protected]
74 verbose linkMans [email protected]
75 verbose rebuildBundles [email protected]
76 info install [email protected]
77 verbose unsafe-perm in lifecycle true
78 silly exec sh "-c" "node-gyp rebuild"
79 silly sh,-c,node-gyp rebuild,/home/user/project/node_modules/node-stringprep spawning
80 info [email protected] Failed to exec install script
81 info /home/user/project/node_modules/node-stringprep unbuild
82 verbose from cache /home/user/project/node_modules/node-stringprep/package.json
83 info preuninstall [email protected]
84 info uninstall [email protected]
85 verbose true,/home/user/project/node_modules,/home/user/project/node_modules unbuild [email protected]
86 info postuninstall [email protected]
87 error [email protected] install: node-gyp rebuild
87 error sh "-c" "node-gyp rebuild" failed with 1
88 error Failed at the [email protected] install script.
88 error This is most likely a problem with the node-stringprep package,
88 error not with npm itself.
88 error Tell the author that this fails on your system:
88 error node-gyp rebuild
88 error You can get their info via:
88 error npm owner ls node-stringprep
88 error There is likely additional logging output above.
89 error System Linux 2.6.18-308.el5.028stab099.3
90 error command "/home/user/bin/node" "/home/user/bin/npm" "i" "node-stringprep"
91 error cwd /home/user/project
92 error node -v v0.8.7
93 error npm -v 1.1.49
94 error code ELIFECYCLE
95 verbose exit [ 1, true ]

Use NAN for forward compatibility

node-stringprep does not compile under node v0.11 due to the v8 api changes. The best solution for version compatibility appears to be to use https://github.com/rvagg/nan

../node-stringprep.cc: At global scope:
../node-stringprep.cc:55:34: error: ‘Arguments’ does not name a type
static Handle New(const Arguments& args)

[and many other errors]

As an example, node-postgres has a pending PR which implements this change @ brianc/node-postgres#477

Install error on centos

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
'configure' finished successfully (0.436s)
Waf: Entering directory /mnt/share/20110812/node_modules/node-stringprep/build' [1/2] cxx: node-stringprep.cc -> build/default/node-stringprep_1.o ../node-stringprep.cc:89: error: expected ‘,’ or ‘...’ before ‘profileType’ ../node-stringprep.cc:89: error: ISO C++ forbids declaration of ‘UStringPrepProfileType’ with no type ../node-stringprep.cc:157: error: use of enum ‘UStringPrepProfileType’ without previous declaration ../node-stringprep.cc: In static member function ‘static v8::Handle<v8::Value> StringPrep::New(const v8::Arguments&)’: ../node-stringprep.cc:62: error: ‘UStringPrepProfileType’ was not declared in this scope ../node-stringprep.cc:62: error: expected;' before ‘profileType’
../node-stringprep.cc:65: error: ‘profileType’ was not declared in this scope
../node-stringprep.cc:72: error: ‘profileType’ was not declared in this scope
../node-stringprep.cc: In constructor ‘StringPrep::StringPrep(int)’:
../node-stringprep.cc:92: error: ‘profileType’ was not declared in this scope
../node-stringprep.cc:92: error: ‘usprep_openByType’ was not declared in this scope
../node-stringprep.cc: In static member function ‘static int StringPrep::parseProfileType(v8::String::Utf8Value&)’:
../node-stringprep.cc:161: error: ‘USPREP_RFC3491_NAMEPREP’ was not declared in this scope
../node-stringprep.cc:163: error: ‘USPREP_RFC3530_NFS4_CS_PREP’ was not declared in this scope
../node-stringprep.cc:165: error: ‘USPREP_RFC3530_NFS4_CS_PREP_CI’ was not declared in this scope
../node-stringprep.cc:167: error: ‘USPREP_RFC3530_NFS4_CIS_PREP’ was not declared in this scope
../node-stringprep.cc:169: error: ‘USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX’ was not declared in this scope
../node-stringprep.cc:171: error: ‘USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX’ was not declared in this scope
../node-stringprep.cc:173: error: ‘USPREP_RFC3722_ISCSI’ was not declared in this scope
../node-stringprep.cc:175: error: ‘USPREP_RFC3920_NODEPREP’ was not declared in this scope
../node-stringprep.cc:177: error: ‘USPREP_RFC3920_RESOURCEPREP’ was not declared in this scope
../node-stringprep.cc:179: error: ‘USPREP_RFC4011_MIB’ was not declared in this scope
../node-stringprep.cc:181: error: ‘USPREP_RFC4013_SASLPREP’ was not declared in this scope
../node-stringprep.cc:183: error: ‘USPREP_RFC4505_TRACE’ was not declared in this scope
../node-stringprep.cc:185: error: ‘USPREP_RFC4518_LDAP’ was not declared in this scope
../node-stringprep.cc:187: error: ‘USPREP_RFC4518_LDAP_CI’ was not declared in this scope
Waf: Leaving directory /mnt/share/20110812/node_modules/node-stringprep/build' Build failed: -> task failed (err #1): {task: cxx node-stringprep.cc -> node-stringprep_1.o} npm ERR! error installing [email protected] Error: [email protected] install:./install.sh npm ERR! error installing [email protected]sh "-c" "./install.sh"failed with 1 npm ERR! error installing [email protected] at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20) npm ERR! error installing [email protected] at ChildProcess.emit (events.js:45:17) npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:171:12) npm ERR! [email protected] install:./install.sh npm ERR!sh "-c" "./install.sh"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] 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! ./install.sh
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!
npm ERR! System Linux 2.6.18-164.el5
npm ERR! command "node" "/usr/local/bin/npm" "install" "node-stringprep"
npm ERR! cwd /mnt/share/20110812
npm ERR! node -v v0.4.2
npm ERR! npm -v 1.0.22
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/share/20110812/npm-debug.log
npm not ok

Build problem on Debian

When trying to build node-stringprep (master) on recent Debian (testing) Linux amd64, the linker step doesn't work properly and tries to link to V8 (which I assume shouldn't happen since those symbols will be provided by Node.js at the time the module is loaded?).
The output of icu-config --ldflags is:

-fPIE -pie -Wl,-z,relro -Wl,-z,now  -ldl -lm   -L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata  -ldl -lm   

which led me to Debian #759792.
If I manually replace the call to icu-config in binding.gyp with:

'libraries': [ '-Wl,-z,relro -Wl,-z,now  -ldl -lm   -L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata  -ldl -lm' ],

the build completes, but npm test then complains about

> grunt test

Running "mochacli:all" (mochacli) task
Cannot load StringPrep-0.5.2 bindings (using fallback). You may need to `npm install node-stringprep`
Cannot load StringPrep-0.5.2 bindings (using fallback). You may need to `npm install node-stringprep`

and I just wanted to make sure this was OK before I update the Debian ticket, since I've never build node-stringprep before and I don't know whether the Cannot load ... messages are expected or not. Thanks :)

js fallback

currently the code for that is in node-xmpp. why not share it with everybody? :)

Unable to install on fedora 15

Here is my npm-debug.log

info it worked if it ends with ok
verbose cli [ 'node', '/usr/bin/npm', 'install', 'node-stringprep' ]
info using [email protected]
info using [email protected]
verbose config file /home/adrien/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/lib/node_modules/npm/npmrc
silly testEngine { name: 'node-xmpp',
silly testEngine   version: '0.2.11',
silly testEngine   main: './lib/node-xmpp',
silly testEngine   description: 'Idiomatic XMPP client, component & server library for node.js',
silly testEngine   author: { name: 'Stephan Maka' },
silly testEngine   dependencies: { 'node-expat': '>=1.3.1', ltx: '>= 0.0.4' },
silly testEngine   repositories: 
silly testEngine    [ { type: 'git',
silly testEngine        path: 'git://github.com/astro/node-xmpp.git' } ],
silly testEngine   homepage: 'http://github.com/astro/node-xmpp',
silly testEngine   bugs: { name: 'http://github.com/astro/node-xmpp/issues' },
silly testEngine   maintainers: 
silly testEngine    [ { name: 'Astro',
silly testEngine        email: '[email protected]',
silly testEngine        url: 'http://spaceboyz.net/~astro/' } ],
silly testEngine   contributors: 
silly testEngine    [ { name: 'Stephan Maka' },
silly testEngine      { name: 'Derek Hammer' },
silly testEngine      { name: 'Daniel Zelisko' },
silly testEngine      { name: 'Michael Geers' },
silly testEngine      { name: 'Nolan Darilek' },
silly testEngine      { name: 'Nathan Rajlich' },
silly testEngine      { name: 'Dhruv Matani' },
silly testEngine      { name: 'Camilo Aguilar' },
silly testEngine      { name: 'Henry Chan' },
silly testEngine      { name: 'Justin Campbell' },
silly testEngine      { name: 'Trent Mick' },
silly testEngine      { name: 'Alexey Shamrin' },
silly testEngine      { name: 'Sonny Piers' },
silly testEngine      { name: 'Chaitanya Gupta' },
silly testEngine      { name: 'Иван' } ],
silly testEngine   licenses: [ { type: 'GPLv3' } ],
silly testEngine   engine: 'node >=0.4.0',
silly testEngine   _id: '[email protected]',
silly testEngine   devDependencies: {},
silly testEngine   engines: { node: '*' },
silly testEngine   _engineSupported: true,
silly testEngine   _npmVersion: '1.0.99',
silly testEngine   _nodeVersion: 'v0.4.12',
silly testEngine   _defaultsLoaded: true }
verbose caching /tmp/node-xmpp/package.json
verbose loadDefaults [email protected]
silly testEngine { name: 'ltx',
silly testEngine   version: '0.0.5',
silly testEngine   main: './lib/index',
silly testEngine   description: '<xml for="node.js">',
silly testEngine   author: { name: 'Stephan Maka' },
silly testEngine   dependencies: { 'node-expat': '>=1.2.0' },
silly testEngine   repositories: 
silly testEngine    [ { type: 'git',
silly testEngine        path: 'http://github.com/astro/ltx.git' } ],
silly testEngine   homepage: 'http://github.com/astro/ltx',
silly testEngine   bugs: { name: 'http://github.com/astro/ltx/issues' },
silly testEngine   maintainers: 
silly testEngine    [ { name: 'Astro',
silly testEngine        email: '[email protected]',
silly testEngine        url: 'http://spaceboyz.net/~astro/' } ],
silly testEngine   contributors: [ { name: 'Stephan Maka' } ],
silly testEngine   licenses: [ { type: 'GPLv3' } ],
silly testEngine   engine: 'node',
silly testEngine   _id: '[email protected]',
silly testEngine   devDependencies: {},
silly testEngine   engines: { node: '*' },
silly testEngine   _engineSupported: true,
silly testEngine   _npmVersion: '1.0.99',
silly testEngine   _nodeVersion: 'v0.4.12',
silly testEngine   _defaultsLoaded: true }
verbose caching /tmp/node-xmpp/node_modules/ltx/package.json
verbose loadDefaults [email protected]
verbose has wscript [ undefined,
verbose has wscript   { file: '/tmp/node-xmpp/node_modules/node-expat/package.json',
verbose has wscript     contributors: false,
verbose has wscript     serverjs: false,
verbose has wscript     wscript: true } ]
silly testEngine { name: 'node-expat',
silly testEngine   version: '1.4.0',
silly testEngine   main: './lib/node-expat',
silly testEngine   description: 'NodeJS binding for fast XML parsing.',
silly testEngine   scripts: 
silly testEngine    { install: 'node-waf configure build',
silly testEngine      update: 'node-waf build',
silly testEngine      test: 'node test.js' },
silly testEngine   dependencies: {},
silly testEngine   devDependencies: { vows: '' },
silly testEngine   repositories: 
silly testEngine    [ { type: 'git',
silly testEngine        path: 'git://github.com/astro/node-expat.git' } ],
silly testEngine   homepage: 'http://github.com/astro/node-expat',
silly testEngine   bugs: { name: 'http://github.com/astro/node-expat/issues' },
silly testEngine   maintainers: 
silly testEngine    [ { name: 'Astro',
silly testEngine        email: '[email protected]',
silly testEngine        url: 'http://spaceboyz.net/~astro/' } ],
silly testEngine   contributors: 
silly testEngine    [ { name: 'Stephan Maka' },
silly testEngine      { name: 'Derek Hammer' },
silly testEngine      { name: 'Iein Valdez' },
silly testEngine      { name: 'Peter Körner' },
silly testEngine      { name: 'Camilo Aguilar' } ],
silly testEngine   licenses: [ { type: 'MIT' } ],
silly testEngine   engine: 'node',
silly testEngine   _id: '[email protected]',
silly testEngine   engines: { node: '*' },
silly testEngine   _engineSupported: true,
silly testEngine   _npmVersion: '1.0.99',
silly testEngine   _nodeVersion: 'v0.4.12',
silly testEngine   _defaultsLoaded: true }
verbose caching /tmp/node-xmpp/node_modules/node-expat/package.json
verbose loadDefaults [email protected]
verbose from cache /tmp/node-xmpp/package.json
verbose into /tmp/node-xmpp [ 'node-stringprep' ]
verbose cache add node-stringprep
verbose cache add [ 'node-stringprep', null ]
silly cache add: name, spec, args [ undefined,
silly cache add: name, spec, args   'node-stringprep',
silly cache add: name, spec, args   [ 'node-stringprep', null ] ]
verbose parsed url { pathname: 'node-stringprep',
verbose parsed url   href: 'node-stringprep' }
info addNamed [ 'node-stringprep', '' ]
verbose addNamed [ null, '' ]
verbose GET node-stringprep
verbose raw, before any munging node-stringprep
verbose url resolving [ 'https://registry.npmjs.org/', './node-stringprep' ]
verbose url resolved https://registry.npmjs.org/node-stringprep
verbose etag "DRQ2GELG442QYVF64D9175EJU"
silly get cb [ 304,
silly get cb   { server: 'CouchDB/1.1.0 (Erlang OTP/R14B03)',
silly get cb     etag: '"DRQ2GELG442QYVF64D9175EJU"',
silly get cb     date: 'Sun, 16 Oct 2011 18:00:22 GMT',
silly get cb     'content-length': '0' } ]
verbose etag node-stringprep from cache
verbose GET node-stringprep/0.0.5
verbose raw, before any munging node-stringprep/0.0.5
verbose url resolving [ 'https://registry.npmjs.org/',
verbose url resolving   './node-stringprep/0.0.5' ]
verbose url resolved https://registry.npmjs.org/node-stringprep/0.0.5
verbose etag "DRQ2GELG442QYVF64D9175EJU"
silly get cb [ 304,
silly get cb   { server: 'CouchDB/1.1.0 (Erlang OTP/R14B03)',
silly get cb     etag: '"DRQ2GELG442QYVF64D9175EJU"',
silly get cb     date: 'Sun, 16 Oct 2011 18:00:23 GMT',
silly get cb     'content-length': '0' } ]
verbose etag node-stringprep/0.0.5 from cache
verbose bin dist [ '0.4-ares1.7.4-ev4.4-openssl1.0.0e-fips-v83.1.8.26-linux-2.6.40.6-0.fc15.x86_64',
verbose bin dist   { shasum: '09f2bb008d16120f003a4ad0770c66fdfc4471ca',
verbose bin dist     bin: 
verbose bin dist      { '0.4-ares1.7.4-ev4.4-openssl1.0.0d-v83.1.8.10-linux-2.6.39.1': 
verbose bin dist         { shasum: '0b196bef6e269ff32b8be22587f072c172d7f745',
verbose bin dist           tarball: 'http://registry.npmjs.org/node-stringprep/-/node-stringprep-0.0.5-0.4-ares1.7.4-ev4.4-openssl1.0.0d-v83.1.8.10-linux-2.6.39.1.tgz' } },
verbose bin dist     tarball: 'http://registry.npmjs.org/node-stringprep/-/node-stringprep-0.0.5.tgz' } ]
verbose has wscript [ undefined,
verbose has wscript   { file: '/home/adrien/.npm/node-stringprep/0.0.5/package/package.json',
verbose has wscript     contributors: false,
verbose has wscript     serverjs: false,
verbose has wscript     wscript: true } ]
silly testEngine { name: 'node-stringprep',
silly testEngine   version: '0.0.5',
silly testEngine   main: './build/default/node-stringprep',
silly testEngine   description: 'ICU StringPrep profiles',
silly testEngine   scripts: { install: './install.sh' },
silly testEngine   dependencies: {},
silly testEngine   repositories: 
silly testEngine    [ { type: 'git',
silly testEngine        path: 'git://github.com/astro/node-stringprep.git' } ],
silly testEngine   homepage: 'http://github.com/astro/node-stringprep',
silly testEngine   bugs: { name: 'http://github.com/astro/node-stringprep/issues' },
silly testEngine   maintainers: 
silly testEngine    [ { name: 'Astro',
silly testEngine        email: '[email protected]',
silly testEngine        url: 'http://spaceboyz.net/~astro/' } ],
silly testEngine   licenses: [ { type: 'MIT' } ],
silly testEngine   engine: 'node',
silly testEngine   _id: '[email protected]',
silly testEngine   devDependencies: {},
silly testEngine   engines: { node: '*' },
silly testEngine   _engineSupported: true,
silly testEngine   _npmVersion: '1.0.99',
silly testEngine   _nodeVersion: 'v0.4.12',
silly testEngine   _defaultsLoaded: true }
verbose caching /home/adrien/.npm/node-stringprep/0.0.5/package/package.json
verbose loadDefaults [email protected]
silly resolved [ { name: 'node-stringprep',
silly resolved     version: '0.0.5',
silly resolved     main: './build/default/node-stringprep',
silly resolved     description: 'ICU StringPrep profiles',
silly resolved     scripts: { install: './install.sh' },
silly resolved     dependencies: {},
silly resolved     repositories: 
silly resolved      [ { type: 'git',
silly resolved          path: 'git://github.com/astro/node-stringprep.git' } ],
silly resolved     homepage: 'http://github.com/astro/node-stringprep',
silly resolved     bugs: { name: 'http://github.com/astro/node-stringprep/issues' },
silly resolved     maintainers: 
silly resolved      [ { name: 'Astro',
silly resolved          email: '[email protected]',
silly resolved          url: 'http://spaceboyz.net/~astro/' } ],
silly resolved     licenses: [ { type: 'MIT' } ],
silly resolved     engine: 'node',
silly resolved     _id: '[email protected]',
silly resolved     devDependencies: {},
silly resolved     engines: { node: '*' },
silly resolved     _engineSupported: true,
silly resolved     _npmVersion: '1.0.99',
silly resolved     _nodeVersion: 'v0.4.12',
silly resolved     _defaultsLoaded: true } ]
info into /tmp/node-xmpp [email protected]
info installOne [email protected]
info unbuild /tmp/node-xmpp/node_modules/node-stringprep
verbose from cache /home/adrien/.npm/node-stringprep/0.0.5/package/package.json
verbose mkdir (expected) error ENOENT, No such file or directory '/tmp/node-xmpp/node_modules/___node-stringprep.npm'
verbose mkdir done: /tmp/node-xmpp/node_modules/___node-stringprep.npm 755
verbose unpack_ uid, gid [ undefined, undefined ]
verbose unpackTarget /tmp/node-xmpp/node_modules/node-stringprep
silly gunzTarPerm modes [ '755', '644' ]
silly spawning [ 'tar',
silly spawning   [ '-zmvxpf',
silly spawning     '/home/adrien/.npm/node-stringprep/0.0.5/package.tgz',
silly spawning     '-o' ],
silly spawning   '/tmp/node-xmpp/node_modules/___node-stringprep.npm' ]
silly tar out package/package.json
silly tar out package/README.markdown
silly tar out package/wscript
silly tar out package/install.sh
silly tar out package/leakcheck.js
silly tar out package/node-stringprep.cc
silly tar out package/LICENSE
silly tar out package/.gitignore
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/package.json
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/README.markdown
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/wscript
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/install.sh
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/leakcheck.js
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/node-stringprep.cc
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/LICENSE
silly asyncMap in gTP /tmp/node-xmpp/node_modules/___node-stringprep.npm/package/.gitignore
silly chmod package 755
verbose gunzed /tmp/node-xmpp/node_modules/___node-stringprep.npm/package
verbose rm'ed /tmp/node-xmpp/node_modules/node-stringprep
verbose renamed [ '/tmp/node-xmpp/node_modules/___node-stringprep.npm/package',
verbose renamed   '/tmp/node-xmpp/node_modules/node-stringprep' ]
verbose has wscript [ undefined,
verbose has wscript   { file: '/tmp/node-xmpp/node_modules/node-stringprep/package.json',
verbose has wscript     contributors: false,
verbose has wscript     serverjs: false,
verbose has wscript     wscript: true } ]
silly testEngine { name: 'node-stringprep',
silly testEngine   version: '0.0.5',
silly testEngine   main: './build/default/node-stringprep',
silly testEngine   description: 'ICU StringPrep profiles',
silly testEngine   scripts: { install: './install.sh' },
silly testEngine   dependencies: {},
silly testEngine   repositories: 
silly testEngine    [ { type: 'git',
silly testEngine        path: 'git://github.com/astro/node-stringprep.git' } ],
silly testEngine   homepage: 'http://github.com/astro/node-stringprep',
silly testEngine   bugs: { name: 'http://github.com/astro/node-stringprep/issues' },
silly testEngine   maintainers: 
silly testEngine    [ { name: 'Astro',
silly testEngine        email: '[email protected]',
silly testEngine        url: 'http://spaceboyz.net/~astro/' } ],
silly testEngine   licenses: [ { type: 'MIT' } ],
silly testEngine   engine: 'node',
silly testEngine   _id: '[email protected]',
silly testEngine   devDependencies: {},
silly testEngine   engines: { node: '*' },
silly testEngine   _engineSupported: true,
silly testEngine   _npmVersion: '1.0.99',
silly testEngine   _nodeVersion: 'v0.4.12',
silly testEngine   _defaultsLoaded: true }
verbose caching /tmp/node-xmpp/node_modules/node-stringprep/package.json
verbose loadDefaults [email protected]
info preinstall [email protected]
verbose from cache /tmp/node-xmpp/node_modules/node-stringprep/package.json
verbose into /tmp/node-xmpp/node_modules/node-stringprep []
silly resolved []
verbose about to build /tmp/node-xmpp/node_modules/node-stringprep
info build /tmp/node-xmpp/node_modules/node-stringprep
verbose from cache /tmp/node-xmpp/node_modules/node-stringprep/package.json
verbose linkStuff [ false, false, false, '/tmp/node-xmpp/node_modules' ]
info linkStuff [email protected]
verbose linkBins [email protected]
verbose linkMans [email protected]
verbose rebuildBundles [email protected]
info install [email protected]
verbose unsafe-perm in lifecycle true
silly exec sh "-c" "./install.sh"
silly spawning [ 'sh',
silly spawning   [ '-c', './install.sh' ],
silly spawning   '/tmp/node-xmpp/node_modules/node-stringprep' ]
info [email protected] Failed to exec install script
ERR! error installing [email protected] Error: [email protected] install: `./install.sh`
ERR! error installing [email protected] `sh "-c" "./install.sh"` failed with 1
ERR! error installing [email protected]     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
ERR! error installing [email protected]     at ChildProcess.emit (events.js:67:17)
ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)
info unbuild /tmp/node-xmpp/node_modules/node-stringprep
verbose from cache /tmp/node-xmpp/node_modules/node-stringprep/package.json
info preuninstall [email protected]
info uninstall [email protected]
verbose unbuild [email protected] [ false,
verbose unbuild [email protected]   '/usr/local/lib/node_modules',
verbose unbuild [email protected]   '/tmp/node-xmpp/node_modules' ]
info postuninstall [email protected]
verbose installOne cb [email protected]
ERR! [email protected] install: `./install.sh`
ERR! `sh "-c" "./install.sh"` failed with 1
ERR! 
ERR! Failed at the [email protected] install script.
ERR! This is most likely a problem with the node-stringprep package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR!     ./install.sh
ERR! You can get their info via:
ERR!     npm owner ls node-stringprep
ERR! There is likely additional logging output above.
ERR! 
ERR! System Linux 2.6.40.6-0.fc15.x86_64
ERR! command "node" "/usr/bin/npm" "install" "node-stringprep"
ERR! cwd /tmp/node-xmpp/examples
ERR! node -v v0.4.12
ERR! npm -v 1.0.99
ERR! code ELIFECYCLE
verbose exit [ 1, true ]

Thanks.

Cannot load StringPrep-0.1.0 bindings

Issue moved from node-xmpp

OS - RHEL 5.5
[email protected]
[email protected]
[email protected]
icu-config --version 4.8.1.1

I have installed everything but still when i use node-xmpp i get the warning

Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'

i did install [email protected] No Luck.

I already installed icu from http://site.icu-project.org/ and also installed libicu-devel-4.2.1-9.1.el5.remi.x86_64 and libicu-4.2.1-9.1.el5.remi.x86_64. But still i get that warning when i use node-xmpp.

Am i missing anything else ?

npm node-gyp build error.

I am installing npm install on my CentOS machine and it gives the following error again and again. I have installed all latest dev-tools

npm WARN engine [email protected]: wanted: {"node":">=0.8 <=0.12"} (current: {"node":"4.4.7","npm":"2.15.8"})

> [email protected] install /root/NodeJSCID/node_modules/node-stringprep
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory `/root/NodeJSCID/node_modules/node-stringprep/build'
  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
In file included from ../node-stringprep.cc:1:0:
../node_modules/nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../node_modules/nan/nan.h:256:25: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../node-stringprep.cc:1:
/root/.node-gyp/4.4.7/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../node-stringprep.cc:1:
/root/.node-gyp/4.4.7/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.4.7/include/node/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/root/.node-gyp/4.4.7/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.4.7/include/node/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../node-stringprep.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/node_stringprep/node-stringprep.o] Error 1
make: Leaving directory `/root/NodeJSCID/node_modules/node-stringprep/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 2.6.32-358.el6.x86_64
gyp ERR! command "/root/.nvm/versions/node/v4.4.7/bin/node" "/root/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/NodeJSCID/node_modules/node-stringprep
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 2.6.32-358.el6.x86_64
npm ERR! argv "/root/.nvm/versions/node/v4.4.7/bin/node" "/root/.nvm/versions/node/v4.4.7/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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 information on how to open an issue for this project with:
npm ERR!     npm bugs node-stringprep
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls node-stringprep
npm ERR! There is likely additional logging output above.

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

npm install node-stringprep

gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 3.4.37-40.44.amzn1.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ec2-user/www/node_modules/node-stringprep
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] 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.4.37-40.44.amzn1.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "node-stringprep"
npm ERR! cwd /home/ec2-user/www
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ec2-user/www/npm-debug.log
npm ERR! not ok code 0

can't build on Ubuntu 8.04

First, I install icu-dev :
sudo apt-get install libicu-dev

Then, I try to install with npm :

$ sudo npm install node-stringprep
npm it worked if it ends with ok
npm cli [ 'install', 'node-stringprep' ]
npm version 0.1.25
npm config file /home/mlecarme/.npmrc
npm config file /usr/local/etc/npmrc
npm install pkg node-stringprep
npm fetch data node-stringprep
npm GET node-stringprep
npm install pkg node-stringprep
npm install pkg [email protected]
npm GET node-stringprep/0.0.2
npm fetch http://registry.npmjs.org/node-stringprep/-/node-stringprep-0.0.2.tgz
npm fetch /usr/local/lib/node/.npm/.cache/node-stringprep/0.0.2/package.tgz
npm content-length 3683
npm downloaded 32%
npm downloaded 100%
npm fetch finished
npm bytes 3683
npm exec tar "xzf" "/usr/local/lib/node/.npm/.cache/node-stringprep/0.0.2/package.tgz" "--strip-components=1" "-C" "/usr/local/lib/node/.npm/.cache/node-stringprep/0.0.2/package"
npm buildAll About to unpack
npm unpack [ 'node-stringprep', '0.0.2' ]
npm exec tar "xzf" "/usr/local/lib/node/.npm/.cache/node-stringprep/0.0.2/package.tgz" "--strip-components=1" "-C" "/usr/local/lib/node/.npm/node-stringprep/0.0.2/package"
npm createMain ./build/default/node-stringprep
npm install node-stringprep-0.0.2
npm exec sh "-c" "./install.sh"
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /opt/node 
'configure' finished successfully (0.196s)
Waf: Entering directory `/usr/local/lib/node/.npm/node-stringprep/0.0.2/package/build'
[1/2] cxx: node-stringprep.cc -> build/default/node-stringprep_1.o
../node-stringprep.cc:89: erreur: expected «,» or «...» before «profileType»
../node-stringprep.cc:89: erreur: ISO C++ forbids declaration of «UStringPrepProfileType» with no type
../node-stringprep.cc:157: erreur: use of enum «UStringPrepProfileType» without previous declaration
../node-stringprep.cc: In static member function «static v8::Handle<v8::Value> StringPrep::New(const v8::Arguments&)»:
../node-stringprep.cc:62: erreur: «UStringPrepProfileType» was not declared in this scope
../node-stringprep.cc:62: erreur: expected `;' before «profileType»
../node-stringprep.cc:65: erreur: «profileType» was not declared in this scope
../node-stringprep.cc:72: erreur: «profileType» was not declared in this scope
../node-stringprep.cc: In constructor «StringPrep::StringPrep(int)»:
../node-stringprep.cc:92: erreur: «profileType» was not declared in this scope
../node-stringprep.cc:92: erreur: «usprep_openByType» was not declared in this scope
../node-stringprep.cc: In static member function «static int StringPrep::parseProfileType(v8::String::Utf8Value&)»:
../node-stringprep.cc:161: erreur: «USPREP_RFC3491_NAMEPREP» was not declared in this scope
../node-stringprep.cc:163: erreur: «USPREP_RFC3530_NFS4_CS_PREP» was not declared in this scope
../node-stringprep.cc:165: erreur: «USPREP_RFC3530_NFS4_CS_PREP_CI» was not declared in this scope
../node-stringprep.cc:167: erreur: «USPREP_RFC3530_NFS4_CIS_PREP» was not declared in this scope
../node-stringprep.cc:169: erreur: «USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX» was not declared in this scope
../node-stringprep.cc:171: erreur: «USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX» was not declared in this scope
../node-stringprep.cc:173: erreur: «USPREP_RFC3722_ISCSI» was not declared in this scope
../node-stringprep.cc:175: erreur: «USPREP_RFC3920_NODEPREP» was not declared in this scope
../node-stringprep.cc:177: erreur: «USPREP_RFC3920_RESOURCEPREP» was not declared in this scope
../node-stringprep.cc:179: erreur: «USPREP_RFC4011_MIB» was not declared in this scope
../node-stringprep.cc:181: erreur: «USPREP_RFC4013_SASLPREP» was not declared in this scope
../node-stringprep.cc:183: erreur: «USPREP_RFC4505_TRACE» was not declared in this scope
../node-stringprep.cc:185: erreur: «USPREP_RFC4518_LDAP» was not declared in this scope
../node-stringprep.cc:187: erreur: «USPREP_RFC4518_LDAP_CI» was not declared in this scope
Waf: Leaving directory `/usr/local/lib/node/.npm/node-stringprep/0.0.2/package/build'
Build failed:  -> task failed (err #1): 
    {task: cxx node-stringprep.cc -> node-stringprep_1.o}
npm node-stringprep-0.0.2 Failed to exec install script
npm install failed Error: node-stringprep-0.0.2 install: `./install.sh`
`sh` failed with 1
    at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.1.25/package/lib/utils/exec.js:27:18)
    at ChildProcess.emit (events:33:26)
    at ChildProcess.onexit (child_process:151:12)
    at node.js:764:9
npm install failed rollback
npm uninstall safe to uninstall: node-stringprep-0.0.2
npm uninstall node-stringprep-0.0.2 remove links
npm uninstall node-stringprep-0.0.2 remove bins
npm uninstall node-stringprep-0.0.2 remove public modules
npm uninstall node-stringprep-0.0.2 remove package dir
npm uninstall node-stringprep-0.0.2 complete
npm install failed rolled back

npm ! Error: node-stringprep-0.0.2 install: `./install.sh`
`sh` failed with 1
    at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.1.25/package/lib/utils/exec.js:27:18)
    at ChildProcess.emit (events:33:26)
    at ChildProcess.onexit (child_process:151:12)
    at node.js:764:9

npm failure try running: 'npm help install'
npm failure Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm failure or email it to <[email protected]>
npm not ok

Unable to install on Mavericks 10.9

I am unable to install the older icu4c as recommended by the README and this module will not install with icu4u 52.1, is there a workaround for this?

  CXX(target) Release/obj.target/node_stringprep/node-stringprep.o
../node-stringprep.cc:2:10: fatal error: 'unicode/unistr.h' file not found
#include <unicode/unistr.h>
         ^
1 error generated.
make: *** [Release/obj.target/node_stringprep/node-stringprep.o] Error 1

/build/default vs /build/Release

Does it matter that package.json defines "main": "./build/default/node-stringprep" but the actual existing path is "./build/Release/node-stringprep" on node v0.6.x? (also in leakcheck.js, btw)

Problem with npm install

I i had a problem with the installation of the package on Window using npm.
I attach the npm error log. Thank you.

ERR! [email protected] preinstall: node-waf clean || (exit 0); node-waf configure build
ERR! cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1
ERR!
ERR! Failed at the [email protected] preinstall script.
ERR! This is most likely a problem with the node-stringprep package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR! node-waf clean || (exit 0); node-waf configure build
ERR! You can get their info via:
ERR! npm owner ls node-stringprep
ERR! There is likely additional logging output above.
ERR!
ERR! System Windows_NT 6.1.7601
ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-stringprep"
ERR! cwd C:\Program Files (x86)\nodejs
ERR! node -v v0.8.19
ERR! npm -v 1.1.0-3
ERR! code ELIFECYCLE
ERR! message [email protected] preinstall: node-waf clean || (exit 0); node-waf configure build
ERR! message cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1
ERR! errno {}
verbose exit [ 1, true ]

Error: Symbol node_stringprep_module not found.

Trying to use this module but I'm getting this error when running an app.js that only contains the lines from the example in the installation steps:

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: Symbol node_stringprep_module not found.
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Server.<anonymous> (/Users/jgabaut/Downloads/stringprep/app.js:34:22)
    at Server.g (events.js:175:14)
    at Server.EventEmitter.emit (events.js:92:17)
    at net.js:1029:10
    at process._tickCallback (node.js:415:13)
    at Function.Module.runMain (module.js:499:11)

Any ideas?

No javascript backup for saslprep

There's no javascript backup for saslprep.

Although using RFC 7613 (implemented by precis-js) instead appears to be a good option.

Problem installing in Yosemite

I'm installing xmpp-node-client. When installing I get this error:

npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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

Node version: v0.12.2
Npm version: 2.10.0

Read in previous closed issues that deleting ~/.node-gyp and retry might work, I had no luck.

This happens when installing through npm install.

Any idea?

add tests

some tests for this package landed in node-xmpp. i think this deserves its own tests.

npm install fails on npm shipped with node 0.6.8?

npm install node-stringprep fails with OSError: [Errno 2] No such file or directory: '/home/stephan/programming/node-stringprep/build'. Such a path is in ./build/.wafpickle-7 which is included in your package in the npm registry. Installing from github works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.