Giter Site home page Giter Site logo

node.bcrypt.js's People

Contributors

alete89 avatar anderslatif avatar charmander avatar cokia avatar defunctzombie avatar erlichmen avatar freewil avatar jfirebaugh avatar kibertoad avatar ksmyth avatar laijonathan avatar lloyd avatar mylesborins avatar ncb000gt avatar nicknaso avatar p-kuen avatar pauliusuza avatar pixelglow avatar rcpeng34 avatar recrsn avatar richardwright avatar rvagg avatar seanmonstar avatar shovon avatar slaks avatar techhead avatar thom-nic avatar tootallnate avatar vadimg avatar zsw007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node.bcrypt.js's Issues

npm error: package.json

Just sayin

npm ERR! Error installing [email protected]
[...]
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse Note that package.json must be actual JSON, not
npm ERR! JSON.parse just a JavaScript object.
npm ERR! JSON.parse 
npm ERR! JSON.parse This changed in npm 0.3.0, and is not a bug in npm.
npm ERR! JSON.parse Tell the package author to fix their package.json file.

PS Thank you for node.bcrypt — I plan to use it so I can actually be secure :)

PPS Here's the extra comma: https://github.com/ncb000gt/node.bcrypt.js/blob/master/package.json#L28

Introductions are broken

Hi guys,

Just wanted to give you a heads up on the fact that the introductions on the readme page is broken.

var hash = bcrypt.encryptSync("B4c0/\/", salt);

Should probably be as shown below:

var hash = bcrypt.hashSync("B4c0/\/", salt);

Thanks for a great addition to node!

issue with node 0.4.7

The bcrypt encrypt function returns the hash as ':' always. works fine with node0.5-pre though

bcrypt v0.3.0 fails to build for me (0.2.4 is fine, however)

[ctide@Chris-Burkharts-MacBook-Pro-2 ]:$ npm install [email protected]

[email protected] install /Volumes/Macintosh HD/Users/ctide/node_modules/bcrypt
node-waf configure build

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 program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for node path : ok /Users/ctide/.node_libraries
Checking for node prefix : not found
Checking for function RAND_bytes : not found
'configure' finished successfully (0.194s)
Waf: Entering directory /Volumes/Macintosh HD/Users/ctide/node_modules/bcrypt/build' [1/4] cxx: src/blowfish.cc -> build/default/src/blowfish_1.o [2/4] cxx: src/bcrypt.cc -> build/default/src/bcrypt_1.o [3/4] cxx: src/bcrypt_node.cc -> build/default/src/bcrypt_node_1.o ../src/bcrypt_node.cc: In function ‘int GetSeed(u_int8_t*, int)’: ../src/bcrypt_node.cc:74: warning: ‘RAND_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:104) ../src/bcrypt_node.cc:74: warning: ‘RAND_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:104) ../src/bcrypt_node.cc:77: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:105) ../src/bcrypt_node.cc:77: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:105) ../src/bcrypt_node.cc: In static member function ‘static int BCrypt::EIO_GenSalt(eio_req*)’: ../src/bcrypt_node.cc:136: warning: deprecated conversion from string constant to ‘char*’ ../src/bcrypt_node.cc:138: warning: deprecated conversion from string constant to ‘char*’ [4/4] cxx_link: build/default/src/blowfish_1.o build/default/src/bcrypt_1.o build/default/src/bcrypt_node_1.o -> build/default/bcrypt_lib.node Waf: Leaving directory/Volumes/Macintosh HD/Users/ctide/node_modules/bcrypt/build'
'build' finished successfully (0.415s)
[email protected] ./node_modules/bcrypt
[ctide@Chris-Burkharts-MacBook-Pro-2 ]:$ npm install [email protected]

[email protected] install /Volumes/Macintosh HD/Users/ctide/node_modules/bcrypt
node-waf configure build

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 program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for node path : ok /Users/ctide/.node_libraries
Checking for node prefix : not found
Checking for function RAND_bytes : not found
'configure' finished successfully (0.181s)
Waf: Entering directory /Volumes/Macintosh HD/Users/ctide/node_modules/bcrypt/build' [1/4] cxx: src/blowfish.cc -> build/default/src/blowfish_1.o [2/4] cxx: src/bcrypt.cc -> build/default/src/bcrypt_1.o [3/4] cxx: src/bcrypt_node.cc -> build/default/src/bcrypt_node_1.o ../src/bcrypt_node.cc: In function ‘int<unnamed>::GetSeed(u_int8_t*, int)’: ../src/bcrypt_node.cc:75: warning: ‘RAND_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:104) ../src/bcrypt_node.cc:75: warning: ‘RAND_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:104) ../src/bcrypt_node.cc:78: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:105) ../src/bcrypt_node.cc:78: warning: ‘RAND_pseudo_bytes’ is deprecated (declared at /usr/include/openssl/rand.h:105) ../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value><unnamed>::GenerateSalt(const v8::Arguments&)’: ../src/bcrypt_node.cc:231: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../src/bcrypt_node.cc:231: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ ../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value><unnamed>::Encrypt(const v8::Arguments&)’: ../src/bcrypt_node.cc:358: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../src/bcrypt_node.cc:358: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ ../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value><unnamed>::Compare(const v8::Arguments&)’: ../src/bcrypt_node.cc:484: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../src/bcrypt_node.cc:484: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ Waf: Leaving directory/Volumes/Macintosh HD/Users/ctide/node_modules/bcrypt/build'
Build failed: -> task failed (err #1):
{task: cxx bcrypt_node.cc -> bcrypt_node_1.o}
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/Volumes/Macintosh HD/Users/ctide/.nvm/v0.4.9/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: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 11.1.0
npm ERR! command "node" "/Users/ctide/.nvm/v0.4.9/bin/npm" "install" "[email protected]"
npm ERR! cwd /Volumes/Macintosh HD/Users/ctide
npm ERR! node -v v0.4.9
npm ERR! npm -v 1.0.22
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Volumes/Macintosh HD/Users/ctide/npm-debug.log
npm not ok

undefined symbol: _ZN2v811HandleScopeC1Ev

Waf: Entering directory /mnt/uw/node_modules/bcrypt/build' [1/4] cxx: src/blowfish.cc -> build/default/src/blowfish_1.o [2/4] cxx: src/bcrypt.cc -> build/default/src/bcrypt_1.o [3/4] cxx: src/bcrypt_node.cc -> build/default/src/bcrypt_node_1.o [4/4] cxx_link: build/default/src/blowfish_1.o build/default/src/bcrypt_1.o build/default/src/bcrypt_node_1.o -> build/default/bcrypt_lib.node Waf: Leaving directory/mnt/uw/node_modules/bcrypt/build'
'build' finished successfully (3.003s)
tonyg@ubuntu10:/mnt/uw/node_modules/bcrypt$ nodeunit /test
The "sys" module is now called "util". It should have a similar interface.
node: symbol lookup error: /mnt/uw/node_modules/bcrypt/build/default/bcrypt_lib.node: undefined symbol: _ZN2v811HandleScopeC1Ev

need an API call to determine current work factor, so one can update it

Specific use case: site decides to update work factor from 10 to 12, would like to update the bcrypted passwords on-the-fly every time a user logs in successfully. The API call could be:

BCrypt.get_work_factor(encrypted)

or the success callback of an async compare could include it as a third parameter.

Random invalid salt

I have some user fixtures that I set up and save to a database when starting up my app in dev mode.

Usually there are no problems but every so often I randomly get the error:
Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue

If I just restart the app then the fixtures load OK. These errors are not triggered by code changes.

Any ideas on why this might be happening?

Issue installing bcrypt

I'm having the same installation issue as #17.

I'm using windows/cygwin

I've followed these instructions for installing node.
https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

I've also followed several of these instructions.
https://gist.github.com/579814

I can successfully run Node.
I have successfully installed a half dozen or so packages with NPM.

bcrypt is the only package I've found which fails.

If someone can help with this I'd really appreciate it.

Here's the end of the error log:

info build /home/Hero/node_modules/bcrypt
verbose from cache /home/Hero/node_modules/bcrypt/package.json
verbose linkStuff [ false, false, false, '/home/Hero/node_modules' ]
info linkStuff [email protected]
verbose linkBins [email protected]
verbose linkMans [email protected]
verbose rebuildBundles [email protected]
verbose rebuildBundles [ '.bin', 'nodeunit' ]
info install [email protected]
verbose unsafe-perm in lifecycle true
silly exec sh "-c" "node-waf configure build"
info [email protected] Failed to exec install script
ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
ERR! error installing [email protected] at ChildProcess. (/usr/local/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 /home/Hero/node_modules/bcrypt
verbose from cache /home/Hero/node_modules/bcrypt/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] '/home/Hero/node_modules' ]
info postuninstall [email protected]
verbose installOne cb [email protected]
ERR! [email protected] install: node-waf configure build
ERR! sh "-c" "node-waf configure build" failed with 1
ERR!
ERR! Failed at the [email protected] install script.
ERR! This is most likely a problem with the bcrypt package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR! node-waf configure build
ERR! You can get their info via:
ERR! npm owner ls bcrypt
ERR! There is likely additional logging output above.
ERR!
ERR! System CYGWIN_NT-6.1-WOW64 1.7.9(0.237/5/3)
ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
verbose exit [ 1, true ]

Build Issues on CentOS 6.2

Well, after spending the last few hours following tons of rabbit holes I was finally able to push to my test server and hit a large snag. When installing via npm or building from source bcrypt blows up at the same spot.

Env:
CentOS 6.2
Node: 0.6.8
Npm: 1.1.0-2
Python: 2.6.6

Any help and thoughts are appreciated!

Log trace:

# node-waf configure
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 program gcc or cc           : /usr/bin/gcc 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for gcc                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for function RAND_bytes         : Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 241, in configure
    conf.sub_config([''])
  File "/usr/local/bin/../lib/node/wafadmin/Configure.py", line 221, in sub_config
    self.recurse(k, name='configure')
  File "/usr/local/bin/../lib/node/wafadmin/Utils.py", line 634, in recurse
    f(self)
  File "/usr/src/node.bcrypt.js/wscript", line 28, in configure
    uselib_store='OPENSSL')
  File "/usr/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 444, in check
    ret = self.run_c_code(*k, **kw)
  File "/usr/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 530, in run_c_code
    bld.compile()
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 273, in compile
    self.generator.start()
  File "/usr/local/bin/../lib/node/wafadmin/Runner.py", line 220, in start
    TaskConsumer.consumers = [TaskConsumer() for i in xrange(self.numjobs)]
  File "/usr/local/bin/../lib/node/wafadmin/Runner.py", line 33, in __init__
    self.start()
  File "/usr/lib/python2.6/threading.py", line 474, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

Via NPM:

# npm install bcrypt
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt

> [email protected] install /usr/src/math_clinic/node_modules/bcrypt
> make build

rm -f bcrypt_lib.node
rm -Rf build
node-waf configure
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 program gcc or cc           : /usr/bin/gcc
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for gcc                         : ok 
Checking for node path                   : not found
Checking for node prefix                 : ok /usr/local
Checking for function RAND_bytes         : Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 241, in configure
    conf.sub_config([''])
  File "/usr/local/bin/../lib/node/wafadmin/Configure.py", line 221, in sub_config
    self.recurse(k, name='configure')
  File "/usr/local/bin/../lib/node/wafadmin/Utils.py", line 634, in recurse
    f(self)
  File "/usr/src/math_clinic/node_modules/bcrypt/wscript", line 28, in configure
    uselib_store='OPENSSL')
  File "/usr/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 444, in check
    ret = self.run_c_code(*k, **kw)
  File "/usr/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 530, in run_c_code
    bld.compile()
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 273, in compile
    self.generator.start()
  File "/usr/local/bin/../lib/node/wafadmin/Runner.py", line 220, in start
    TaskConsumer.consumers = [TaskConsumer() for i in xrange(self.numjobs)]
  File "/usr/local/bin/../lib/node/wafadmin/Runner.py", line 33, in __init__
    self.start()
  File "/usr/lib/python2.6/threading.py", line 474, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread
make: *** [configure] Error 1
npm ERR! error installing [email protected]
npm ERR! [email protected] install: `make build`
npm ERR! `sh "-c" "make build"` failed with 2
npm ERR!
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make build
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.35
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /usr/src/math_clinic
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `make build` 
npm ERR! message `sh "-c" "make build"` failed with 2
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/src/math_clinic/npm-debug.log
npm not ok

Segfault related to OpenSSL

I haven't been able to trace roots yet, but I wanted to capture what I've found.

I created https://gist.github.com/1187800 script to just blast async gen_salt calls through. This causes a segfault. I traced it down with gdb and node_g and consistently got:

  (gdb) run test.js
  Starting program: /usr/local/bin/node_g test.js
  [Thread debugging using libthread_db enabled]
  [New Thread 0x7ffff627f700 (LWP 885)]
  [New Thread 0x7ffff7f39700 (LWP 886)]
  [New Thread 0x7ffff7ef8700 (LWP 887)]
  [New Thread 0x7ffff7eb7700 (LWP 888)]
  [New Thread 0x7ffff7e76700 (LWP 889)]

  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 0x7ffff7e76700 (LWP 889)]
  sha1_block_data_order () at sha1-x86_64.s:81
  81    sha1-x86_64.s: No such file or directory.
      in sha1-x86_64.s

I know that it relates to libcrypto because the sha1-x86_64.s bits turn up related to openssl when searching for information. Plus, before I added libssl-dbg gdb would inform me that /lib/libcrypto was the issue.

  $ ldd build/default/bcrypt_lib.node
  linux-vdso.so.1 =>  (0x00007fff95990000)
  libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007fdab5ce6000)
  libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdab59e0000)
  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdab575a000)
  libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdab5544000)
  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdab51b0000)
  libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007fdab4e20000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fdab617e000)
  libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdab4c1c000)
  libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdab4a04000)

I couldn't find much related other than this is using libcrypto (libssl on ubuntu) 0.9.8.

That was about where I ended up tracing this down. Will look more at later.

Error installing bcrypt in Linux Mint

Hi, I needed to install mongoose-auth which needs bcrypt and I get the following error:

rm -f bcrypt_lib.node
rm -Rf build
node-waf configure
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 program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /home/albertoelias/local
Checking for function RAND_bytes : no such environment: default
Traceback (most recent call last):
File "/home/albertoelias/local/bin/node-waf", line 16, in
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Scripting.py", line 241, in configure
conf.sub_config([''])
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Configure.py", line 221, in sub_config
self.recurse(k, name='configure')
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Utils.py", line 634, in recurse
f(self)
File "/home/albertoelias/node_modules/bcrypt/wscript", line 29, in configure
uselib_store='OPENSSL')
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 444, in check
ret = self.run_c_code(_k, *_kw)
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 521, in run_c_code
o = bld(features=kw['features'], source=test_f_name, target='testprog')
File "/home/albertoelias/local/bin/../lib/node/wafadmin/Build.py", line 343, in call
return TaskGen.task_gen(_k, *_kw)
File "/home/albertoelias/local/bin/../lib/node/wafadmin/TaskGen.py", line 118, in init
self.env = self.bld.env.copy()
AttributeError: 'NoneType' object has no attribute 'copy'
make: *** [configure] Error 1
npm ERR! error installing [email protected] Error: [email protected] install: make build
npm ERR! error installing [email protected] sh "-c" "make build" failed with 2
npm ERR! error installing [email protected] at ChildProcess. (/home/albertoelias/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: make build
npm ERR! sh "-c" "make build" failed with 2
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make build
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.38-8-generic
npm ERR! command "node" "/home/albertoelias/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /home/albertoelias
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.27
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/albertoelias/npm-debug.log
npm not ok

I've tried a lot of different things but I haven't managed to get it working...

Install problem on OSX Lion - Could not configure a cxx compiler

I recently upgraded my mac to Lion. Bcrypt was working fine before the upgrade, but when trying to install the module post upgrade I keep getting the following error:

/Users/vik/local_repo/myapp/node_modules/bcrypt/wscript:16: error: could not configure a cxx compiler!

I've installed xcode 4.1, and ran /Applications/Installxcode.app as per the other closed issues but its still not working.

compare_sync with an empty string throws an error

We found a major backwards incompatibility and a possible bug in compare_sync when updating from bcrypt 0.4.0 to 0.4.1.

This is how it used to work:

~ $ npm-g install [email protected]
... snip ...
[email protected] /usr/local/lib/node_modules/bcrypt 
~ $ node
> var bcrypt = require('bcrypt')
undefined
> bcrypt.compare_sync('', 'password')
false

This is how it works now:

~ $ npm-g install [email protected]
... snip ...
[email protected] /usr/local/lib/node_modules/bcrypt 
~ $ node                      
> var bcrypt = require('bcrypt')
undefined
> bcrypt.compare_sync('', 'password')
Error: data and hash arguments required
at Object.compare_sync (/usr/local/lib/node_modules/bcrypt/bcrypt.js:111:15)
at repl:1:9
at REPLServer.eval (repl.js:80:21)
at Interface.<anonymous> (repl.js:182:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream.<anonymous> (readline.js:82:12)
at ReadStream.emit (events.js:88:20)

I think an empty string should be a valid argument for compare_sync.

Running on Node 0.6.6.

concurrency issue with async compare

There seems to be some kind race condition with the async version of compare. The below sample will fail on the first compare about once every 100-200 iterations on my quad-core machine. It takes a lot more iterations on a dual-core though.

I have reproduced this on linux and windows, x86 and x64.

var bcrypt = require('bcrypt'),
    assert = require('assert'),
    salt = bcrypt.gen_salt_sync(10),
    idx = 0;

function next(){
  return test('secret' + Math.random());
}

function test(password) {
  idx += 1;
  return bcrypt.encrypt(password, salt, function(err, hash) {
    if (err) throw err;
    console.log('bcrypt iter ' + idx);

    assert.ok(hash);
    for (var x = 0; x < 16; x++) {

      bcrypt.compare(password, hash, function(err, res) {
        if (err) throw err;
        assert.ok(res);
      });

      bcrypt.compare('bad' + password, hash, function(err, res) {
        if (err) throw err;
        assert.ok(!res);
      });

    }

    next();
  });
}

next();

compile error v0.2.1 on Mac OS X

Looks like theres a typo in src/bcrypt_node.cc causing compilation errors. Line 445:

return Boolean::New(CompareString(bcrypt(*pw, *hash), *hash));

(singular "CompareString") needs to be:

return Boolean::New(CompareStrings(bcrypt(*pw, *hash), *hash));

(plural "CompareStrings")

Different issue installing

I get this response when attempting to install (non-global) bcrypt. 'Scripting' doesn't appear to be in the npm registry. I'm able to install other node packages through npm without issue.

OS: MacOSX Leopard
node -v: v0.5.0-pre
npm -v: 1.0.9-1

Traceback (most recent call last):
File "/usr/local/bin/node-waf", line 14, in
import Scripting
ImportError: No module named Scripting
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" 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:246:12)
npm ERR! [email protected] install: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 9.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/lib/node_projects/calipso/npm-debug.log
npm not ok

npm not ok

alfred@alfred-laptop:/www$ npm install bcrypt
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 program gcc or cc : /usr/bin/gcc
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /home/alfred/local
Checking for library bsd : yes
'configure' finished successfully (0.172s)
Waf: Entering directory /home/ncampbell/Code/node.bcrypt.js/build' Waf: Leaving directory/home/ncampbell/Code/node.bcrypt.js/build'
Traceback (most recent call last):
File "/home/alfred/local/bin/node-waf", line 16, in
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/home/alfred/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/home/alfred/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/home/alfred/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/home/alfred/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
return build_impl(bld)
File "/home/alfred/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
bld.compile()
File "/home/alfred/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/home/ncampbell/Code/node.bcrypt.js/build'
npm info [email protected] Failed to exec install script
npm ERR! install failed Error: [email protected] install: node-waf configure build
npm ERR! install failed sh failed with 1
npm ERR! install failed at ChildProcess. (/home/alfred/local/lib/node/.npm/npm/0.2.17/package/lib/utils/exec.js:25:18)
npm ERR! install failed at ChildProcess.emit (events:34:17)
npm ERR! install failed at ChildProcess.onexit (child_process:168:12)
npm ERR! install failed at node.js:773:9
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: node-waf configure build
npm ERR! sh failed with 1
npm ERR! at ChildProcess. (/home/alfred/local/lib/node/.npm/npm/0.2.17/package/lib/utils/exec.js:25:18)
npm ERR! at ChildProcess.emit (events:34:17)
npm ERR! at ChildProcess.onexit (child_process:168:12)
npm ERR! at node.js:773:9
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There may be additional logging output above.
npm not ok
alfred@alfred-laptop:
/www$ cat /etc/issue
Ubuntu 10.10 \n \l

alfred@alfred-laptop:~/www$ node -v
v0.2.6

I have installed

sudo apt-get install libbsd-dev

also npm not ok on node v0.3.7.

SegFault with bcrypt.compare in node 5.10

Using node 5.10 the bcrypt.compare('pass','hash',fun(er,res){}) function causes a segfault. The same code when run against node 4.7 runs fine. The sync version (bcrypt.compare_sync) works fine.

this is run against bcrypt version .0.4.0

Thanks.

Comparator possibly vulnerable to timing attacks.

The comparison functions were using strcmp which compares each character at a time checking for non-matches, at the first non-match it bails returning -1, 0 or 1. This is how timing attacks are formed.

@thegoleffect asked about whether this module was vulnerable to this kind of attack. I looked into it and believe it is.

bsd/random.h error while installing via NPM on Webfaction hosting

Hi there,

I tried install bcrypt for node via NPM, but wasn't able to succeed.

Error I got is like this,

[[username]@web159 webapps]$ npm install bcrypt
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info fetch http://registry.npmjs.org/bcrypt/-/bcrypt-0.1.1.tgz
npm info calculating sha1 /tmp/npm-1296416911235/1296416911235-0.774519074941054/tmp.tgz
npm info shasum 24a1c6c7e85fe1f3656c15f0e88fa0699704ea72
npm info calculating sha1 /home/[username]/lib/node/.npm/.cache/bcrypt/0.1.1/package.tgz
npm info shasum 99ae9fdfd210ffc53da0138a167275f2ba94b38f
npm info range nodeunit@>=0.3.1
npm info fetch http://registry.npmjs.org/nodeunit/-/nodeunit-0.5.0.tgz
npm info calculating sha1 /home/[username]/lib/node/.npm/.cache/nodeunit/0.5.0/package.tgz
npm info shasum e776feb63b29ecd1af2cd5f74e404609a4004c3e
npm info preinstall [email protected]
npm info preinstall [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 program gcc or cc : /usr/bin/gcc
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for node path : ok /home/[username]/lib/node
Checking for node prefix : ok /home/[username]
Checking for library bsd : yes
'configure' finished successfully (0.460s)
Waf: Entering directory /home/[username]/lib/node/.npm/bcrypt/0.1.1/package/build' [1/4] cxx: src/blowfish.cc -> build/default/src/blowfish_1.o [2/4] cxx: src/bcrypt.cc -> build/default/src/bcrypt_1.o [3/4] cxx: src/bcrypt_node.cc -> build/default/src/bcrypt_node_1.o ../src/bcrypt.cc:57:24: error: bsd/random.h: No such file or directory ../src/bcrypt.cc: In function ‘char* bcrypt_gensalt(u_int8_t)’: ../src/bcrypt.cc:164: error: ‘arc4random’ was not declared in this scope Waf: Leaving directory/home/[username]/lib/node/.npm/bcrypt/0.1.1/package/build'
Build failed: -> task failed (err #1):
{task: cxx bcrypt.cc -> bcrypt_1.o}
npm info [email protected] Failed to exec preinstall script
npm ERR! install failed Error: [email protected] preinstall: node-waf configure build
npm ERR! install failed sh failed with 1
npm ERR! install failed at ChildProcess. (/home/[username]/lib/node/.npm/npm/0.2.16/package/lib/utils/exec.js:25:18)
npm ERR! install failed at ChildProcess.emit (events:27:15)
npm ERR! install failed at ChildProcess.onexit (child_process:151:12)
npm ERR! install failed at node.js:768:9
npm info install failed rollback
npm info uninstall [ '[email protected]'
npm info uninstall , '[email protected]'
npm info uninstall ]
npm info preuninstall [email protected]
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info uninstall [email protected]
npm info auto-deactive not symlink
npm info auto-deactive not symlink
npm info postuninstall [email protected]
npm info postuninstall [email protected]
npm info uninstall [email protected] complete
npm info uninstall [email protected] complete
npm info install failed rolled back
npm ERR! Error: [email protected] preinstall: node-waf configure build
npm ERR! sh failed with 1
npm ERR! at ChildProcess. (/home/[username]/lib/node/.npm/npm/0.2.16/package/lib/utils/exec.js:25:18)
npm ERR! at ChildProcess.emit (events:27:15)
npm ERR! at ChildProcess.onexit (child_process:151:12)
npm ERR! at node.js:768:9
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There may be additional logging output above.
npm not ok

Not sure what to make of it. It says that BSD lib exists but can't find bsd/random.h.
Any ideas?

Thanks!

Add support for node.js 0.5.x (undefined symbol: ev_rt_now)

(EDIT: from comments below, seems like this may be related to using node.js v 0.5.x)

I'm trying to run the mongoose-auth examples, but am running into issues with bcrypt. I'm still a node newbie, but I think everything compiled properly, and all other modules, applications, etc. run perfectly fine on my installation. It doesn't look like an issue with mongoose-auth, but rather something going on with bcrypt? (I have openSSL installed, according to the docs there are no other dependencies?)

This is the error I get when trying to run mongoose-auth examples:

jesse:~/trackinggame/chat/node_modules/mongoose-auth/example$ node server.js 

node.js:180
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: /home/jesse/trackinggame/chat/node_modules/bcrypt/build/default/bcrypt_lib.node: undefined symbol: ev_rt_now
    at Object..node (module.js:456:11)
    at Module.load (module.js:339:31)
    at Function._load (module.js:298:12)
    at require (module.js:351:19)
    at Object.<anonymous> (/home/jesse/trackinggame/chat/node_modules/bcrypt/bcrypt.js:1:88)
    at Module._compile (module.js:411:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:339:31)
    at Function._load (module.js:298:12)
    at require (module.js:351:19)

And here is the output after installing bcrypt:

jesse:~/trackinggame/chat$ npm install bcrypt

> [email protected] install /home/jesse/trackinggame/chat/node_modules/bcrypt
> node-waf configure build

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 program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /home/jesse/local/node 
Checking for function RAND_bytes         : yes 
'configure' finished successfully (0.220s)
Waf: Entering directory `/home/jesse/trackinggame/chat/node_modules/bcrypt/build'
[1/4] cxx: src/blowfish.cc -> build/default/src/blowfish_1.o
[2/4] cxx: src/bcrypt.cc -> build/default/src/bcrypt_1.o
[3/4] cxx: src/bcrypt_node.cc -> build/default/src/bcrypt_node_1.o
[4/4] cxx_link: build/default/src/blowfish_1.o build/default/src/bcrypt_1.o build/default/src/bcrypt_node_1.o -> build/default/bcrypt_lib.node
Waf: Leaving directory `/home/jesse/trackinggame/chat/node_modules/bcrypt/build'
'build' finished successfully (0.510s)
[email protected] ./node_modules/bcrypt 
└── [email protected]

Sorry if this isn't actually a bcrypt issue, but that's what it looks like from the outputs I'm seeing.

Error installing via npm

When I install directly with NPM, I get:

Traceback (most recent call last):
File "/usr/local/bin/node-waf", line 16, in
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
return build_impl(bld)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
bld.compile()
File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory:
'/home/ncampbell/Code/node.bcrypt.js/build'

I can successfully build with node-waf configure && node-waf install && npm install, but it looks like npm install bcrypt by itself isn't running something it should.

Encrypt API is misleading

Encrypt usually has decrypt. Hash is one way. The original api now seems more appropriate.

I'd likely go slowly by deprecating the current API.

Would you (the users) be pissed if I changed it back? Thoughts? Let me know.

Segfault in async encrypt

[email protected] from npm
node v0.6.2

var bcrypt = require('bcrypt');
var salt = bcrypt.gen_salt_sync(10);
bcrypt.encrypt("B4c0//", salt, function(err, hash) { console.log(hash); });
Segmentation fault

Using encrypt_sync works fine.

README.md example incorrect

The usage example in README.md seems to indicate that to check a password one first calls gen_salt to generate some salt. Really? Surely one retrieves the salt from the password database.

undefined symbol: ev_default_loop_ptr

I updated my node to 0.5.0 from 0.4.12 and I am getting this error.

Error: /home/madhu/work/project/node_modules/mongoose-auth/node_modules/bcrypt/build/Release/bcrypt_lib.node: undefined symbol: ev_default_loop_ptr
    at Object..node (module.js:423:11)
    at Module.load (module.js:343:31)
    at Function._load (module.js:302:12)
    at require (module.js:355:19)
    at Object.<anonymous> (/home/madhu/work/project/node_modules/mongoose-auth/node_modules/bcrypt/bcrypt.js:5:18)
    at Module._compile (module.js:411:26)
    at Object..js (module.js:417:10)
    at Module.load (module.js:343:31)
    at Function._load (module.js:302:12)
    at require (module.js:355:19)

Error: No callback supplied

I made the following function:

  var encryptPassword = function(password, next) {
    bcrypt.gen_salt(function(err, salt) {
      if (err) return next(err);
      bcrypt.encrypt(password, salt, function(err, password_crypt) {
        if (err) return next(err);
        return next(null, password_crypt);
      });
    });
  };

When using it I get:

Error: No callback supplied.

Yes I did. I supplied it right there. What I did not supply were the rounds nor the seed_length because the readme said that both are optional.

Issue installing bcrypt

I was trying to install mongoose-auth which also installs bcrypt but I got this error :

node-waf: command not found
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 127
npm ERR! error installing [email protected] at ChildProcess. (/usr/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! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 127
npm ERR! error installing [email protected] at ChildProcess. (/usr/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: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 127
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.18-194.26.1.el5
npm ERR! command "node" "/usr/bin/npm" "install" "mongoose-auth"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/tgv/npm-debug.log
npm not ok

I don't know if whether it's a node issue or bcrypt issue.

NPM version : 1.0.1rc9
Node version : 0.5.0-pre

Characters that appear in hashed passwords

I needed to know what characters can appear in hashed passwords so I'd know if they needed encoding. After poking round in the source the answer is any of:

./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$

It would be nice if you could add this to the README. Thank you.

Symbol not found: _ev_default_loop_ptr

Running under node v0.4.7 on Mac OS X 10.7.2, bcrypt v0.4.1:

Error: dlopen(.../bcrypt/build/Release/bcrypt_lib.node, 1): Symbol not found: _ev_default_loop_ptr
  Referenced from: .../bcrypt/build/Release/bcrypt_lib.node
  Expected in: flat namespace
 in .../bcrypt/build/Release/bcrypt_lib.node
    at Object..node (module.js:416:11)
    at Module.load (module.js:336:31)
    ...

To resolve it, i:

And for good measure to allow make configure to find everything, i:

  • set NODE_PATH
  • changed wscript, line 22: libssl = conf.check(lib="crypto",
    • which, interestingly, causes the following warnings, which doesn't happen with ="ssl" even through those directories don't exist:

        ld: warning: directory not found for option '-L/lib'
        ld: warning: directory not found for option '-L/usr/sfw/lib'
      

dyld: lazy symbol binding failed: Symbol not found

I'm running this module on OSX 10.6.6, node.js v0.4.1, with bcrypt installed by 'npm install bcrypt'.

When I require('bcrypt'), I get these messages:

dyld: lazy symbol binding failed: Symbol not found: __ZN2v811HandleScopeC1Ev
  Referenced from: /usr/local/Cellar/node-v/0.4.1/lib/node/.npm/bcrypt/0.2.3/package/build/default/bcrypt_lib.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v811HandleScopeC1Ev
  Referenced from: /usr/local/Cellar/node-v/0.4.1/lib/node/.npm/bcrypt/0.2.3/package/build/default/bcrypt_lib.node
  Expected in: flat namespace

Install fails under OSX Lion

Hi,

I try to install with

npm install bcrypt

I am running with node 0.4.7 and npm 1.0.106 under Mac OSX 10.7 Lion.

I have openssl and pkg-config installed and compiled node with

./configure --openssl-libpath=/usr/local/ssl/lib --openssl-includes=/usr/local/ssl/include

This is the error log I get:

> [email protected] install /Users/elias/myApp/node_modules/bcrypt
> make build

rm -f bcrypt_lib.node
rm -Rf build
node-waf configure
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 program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /usr/local/lib/node 
Checking for node prefix                 : ok /usr/local 
Checking for function RAND_bytes         : no such environment: default
Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 241, in configure
    conf.sub_config([''])
  File "/usr/local/bin/../lib/node/wafadmin/Configure.py", line 221, in sub_config
    self.recurse(k, name='configure')
  File "/usr/local/bin/../lib/node/wafadmin/Utils.py", line 634, in recurse
    f(self)
  File "/Users/elias/myApp/node_modules/bcrypt/wscript", line 27, in configure
    uselib_store='OPENSSL')
  File "/usr/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 444, in check
    ret = self.run_c_code(*k, **kw)
  File "/usr/local/bin/../lib/node/wafadmin/Tools/config_c.py", line 521, in run_c_code
    o = bld(features=kw['features'], source=test_f_name, target='testprog')
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 343, in __call__
    return TaskGen.task_gen(*k, **kw)
  File "/usr/local/bin/../lib/node/wafadmin/TaskGen.py", line 118, in __init__
    self.env = self.bld.env.copy()
AttributeError: 'NoneType' object has no attribute 'copy'
make: *** [configure] Error 1
npm ERR! error installing [email protected] Error: [email protected] install: `make build`
npm ERR! error installing [email protected] `sh "-c" "make build"` failed with 2
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:67:17)
npm ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] install: `make build`
npm ERR! `sh "-c" "make build"` failed with 2
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make build
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /Users/elias/myApp
npm ERR! node -v v0.4.7
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/elias/myApp/npm-debug.log
npm not ok

Do you have any ideas what I could try?

bcrypt installation

Hope I'm right here.
Have used bcrypt on WIN and Linux (Xubuntu) and -- because of moving to a new Macbook Pro / OSX 10.6.8 -- I need to install it also on that machine.

My background with OSX is near to zero, so a compile would not help. Is there anywhere an instable version available?
If yes, please post the location (and if possible a Howto to install).

Thanks
Günter

IF this isn't the right place to get that info, please give a correct pointer.

Can bcrypt.js be used in windows?

Tried to use compiled on my Mac bcrypt_lib.node, bun on windows it says: Unable to load shared library...

Is it a way to get it work on windows (I need it for mongoose-auth module)?

Version 1.2.0 takes significantly longer to generate a hash

Library versions:
libbsd: 0.2.0 (Fedora 14 RPM)
node: 0.2.6
bcrypt: 0.1.1 / 0.1.2

How to replicate issue:

Uninstall bcrypt
npm uninstall bcrypt

Create test.js file
cat << EOF > test.js
var bcrypt = require('bcrypt')
var salt = bcrypt.gen_salt(20)
console.log('Salt: ' + salt)
var hash = bcrypt.hashpw('test', salt)
console.log('Hash: ' + hash)
EOF

Install version 0.1.1
npm install https://github.com/ncb000gt/node.bcrypt.js/tarball/v0.1.1

Run test.js file (0.1.1)
[silas@x201 Desktop]$ time node test.js
Salt: $2a$04$7I4MWrDc3CrmStnEW2RAA.
Hash: $2a$04$7I4MWrDc3CrmStnEW2RAA.t/C7a/kNqeZv9WlLr4QXiNI6xkMvaou

real    0m0.049s
user    0m0.042s
sys     0m0.006s

Uninstall version 0.1.1 and install version 0.1.2
npm uninstall bcrypt
npm install https://github.com/ncb000gt/node.bcrypt.js/tarball/v0.1.2

Run test.js file again (0.1.2)
[silas@x201 Desktop]$ time node test.js
Salt: $2a$20$bIaij81fmSy6b2982YOIAe
Hash: $2a$20$bIaij81fmSy6b2982YOIAecuvjOQarQ8dXz9amj.4/lnr8Shs9i2i

real    2m37.058s
user    2m36.497s
sys     0m0.040s

Let me know if I'm doing something stupid or you'd like me to do additional testing.

bcrypt.gen_salt(rounds): Rounds ignored?

I have the following code:

var pw = req.param("pass");
var salt = bcrypt.gen_salt(10);
var hsh  = bcrypt.hashpw(pw, salt);

sys.puts('Bcrypt: ' + hsh + ' salt: ' + salt + "\n");

Which returns a bcrypt salt like (for any value passed to gen_salt):

$2a$04$GRewaxy5IkP.TQO8IzMjcu

Maybe I'm wrong, but it looks like it isn't taking the rounds argument into effect?

I'm running node 0.3.1 on Gentoo.

Issues installing on OS X 10.7

Hi, when running npm install bcrypt I get the following error:

    [email protected] install /Users/jamiltao/nodejs/wrtsat/node_modules/bcrypt
    > node-waf configure build

    Checking for program g++ or c++          : /Developer/usr/bin/g++ 
    Checking for program cpp                 : /Developer/usr/bin/cpp 
    Checking for program ar                  : /Developer/usr/bin/ar 
    Checking for program ranlib              : /Developer/usr/bin/ranlib 
    Checking for g++                         : ok  
    Checking for program gcc or cc           : /Developer/usr/bin/gcc 
    Checking for gcc                         : ok  
    Checking for node path                   : not found 
    Checking for node prefix                 : ok /usr/local/Cellar/node/0.4.7 
    Checking for function RAND_bytes         : not found 
    'configure' finished successfully (0.161s)
    Waf: Entering directory `/Users/jamiltao/nodejs/wrtsat/node_modules/bcrypt/build'
    [1/4] cxx: src/blowfish.cc -> build/default/src/blowfish_1.o
    [2/4] cxx: src/bcrypt.cc -> build/default/src/bcrypt_1.o
    [3/4] cxx: src/bcrypt_node.cc -> build/default/src/bcrypt_node_1.o
    ../src/blowfish.cc:47:23: error: sys/types.h: No such file or directory
    In file included from ../src/blowfish.cc:49:
    ../src/node_blf.h:60: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:61: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:70: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:70: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:71: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:71: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:73: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:73: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:75: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:75: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:79: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:79: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:80: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:80: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:81: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:81: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:83: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:83: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:84: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:84: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:90: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:93: error: ‘u_int8_t’ was not declared in this scope
    ../src/node_blf.h:93: error: ‘u_int8_t’ was not declared in this scope
    ../src/node_blf.h:93: error: expected primary-expression before ‘)’ token
    ../src/node_blf.h:93: error: initializer expression list treated as compound expression
    ../src/node_blf.h:95: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:95: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:95: error: ‘u_int8_t’ has not been declared
    ../src/blowfish.cc:68: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc:68: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc: In function ‘void Blowfish_encipher(blf_ctx*, int*, int*)’:
    ../src/blowfish.cc:70: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:70: error: expected `;' before ‘Xl’
    ../src/blowfish.cc:71: error: expected `;' before ‘Xr’
    ../src/blowfish.cc:72: error: ‘s’ was not declared in this scope
    ../src/blowfish.cc:72: error: ‘struct BlowfishContext’ has no member named ‘S’
    ../src/blowfish.cc:73: error: ‘p’ was not declared in this scope
    ../src/blowfish.cc:73: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:75: error: ‘Xl’ was not declared in this scope
    ../src/blowfish.cc:76: error: ‘Xr’ was not declared in this scope
    ../src/bcrypt.cc:48:19: error: stdio.h: No such file or directory
    ../src/bcrypt.cc:49:20: error: stdlib.h: No such file or directory
    ../src/bcrypt.cc:50:23: error: sys/types.h: No such file or directory
    ../src/bcrypt.cc:51:20: error: string.h: No such file or directory
    ../src/bcrypt.cc:52:17: error: pwd.h: No such file or directory
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:93: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc:93: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc: In function ‘void Blowfish_decipher(blf_ctx*, int*, int*)’:
    ../src/blowfish.cc:95: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:95: error: expected `;' before ‘Xl’
    ../src/blowfish.cc:96: error: expected `;' before ‘Xr’
    ../src/blowfish.cc:97: error: ‘s’ was not declared in this scope
    ../src/blowfish.cc:97: error: ‘struct BlowfishContext’ has no member named ‘S’
    ../src/blowfish.cc:98: error: ‘p’ was not declared in this scope
    ../src/blowfish.cc:98: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:100: error: ‘Xl’ was not declared in this scope
    In file included from ../src/bcrypt.cc:54:
    ../src/node_blf.h:60: error: ‘u_int32_t’ does not name a type
    ../src/blowfish.cc:101: error: ‘Xr’ was not declared in this scope
    ../src/node_blf.h:61: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:70: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:70: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:71: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:71: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:73: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:73: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:75: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:75: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:79: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:79: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:80: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:80: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:81: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:81: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:83: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:83: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:84: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:84: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:90: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:93: error: ‘u_int8_t’ was not declared in this scope
    ../src/node_blf.h:93: error: ‘u_int8_t’ was not declared in this scope
    ../src/node_blf.h:93: error: expected primary-expression before ‘)’ token
    ../src/node_blf.h:93: error: initializer expression list treated as compound expression
    ../src/node_blf.h:95: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:95: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:95: error: ‘u_int8_t’ has not been declared
    ../src/bcrypt.cc:74: error: variable or field ‘encode_base64’ declared void
    ../src/bcrypt.cc:74: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt.cc:74: error: expected primary-expression before ‘,’ token
    ../src/bcrypt.cc:74: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt.cc:74: error: expected primary-expression before ‘,’ token
    ../src/bcrypt.cc:74: error: ‘u_int16_t’ was not declared in this scope
    ../src/bcrypt.cc:75: error: variable or field ‘decode_base64’ declared void
    ../src/bcrypt.cc:75: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt.cc:75: error: expected primary-expression before ‘,’ token
    ../src/bcrypt.cc:75: error: ‘u_int16_t’ was not declared in this scope
    ../src/bcrypt.cc:75: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt.cc:75: error: expected primary-expression before ‘)’ token
    ../src/bcrypt.cc:81: error: ‘u_int8_t’ does not name a type
    ../src/bcrypt.cc:84: error: ‘u_int8_t’ does not name a type
    ../src/bcrypt.cc:102: error: variable or field ‘decode_base64’ declared void
    ../src/bcrypt.cc:102: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt.cc:102: error: ‘buffer’ was not declared in this scope
    ../src/bcrypt.cc:102: error: ‘u_int16_t’ was not declared in this scope
    ../src/blowfish.cc: In function ‘void Blowfish_initstate(blf_ctx*)’:
    ../src/blowfish.cc:391: error: too many initializers for ‘const blf_ctx’
    ../src/bcrypt.cc:102: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt.cc:102: error: ‘data’ was not declared in this scope
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:396: error: ‘u_int32_t’ does not name a type
    ../src/blowfish.cc:418: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/blowfish.cc:418: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/blowfish.cc: In function ‘void Blowfish_expand0state(blf_ctx*, int)’:
    ../src/blowfish.cc:420: error: ‘u_int16_t’ was not declared in this scope
    ../src/blowfish.cc:420: error: expected `;' before ‘i’
    ../src/blowfish.cc:421: error: expected `;' before ‘j’
    ../src/blowfish.cc:422: error: expected `;' before ‘k’
    ../src/blowfish.cc:423: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:423: error: expected `;' before ‘temp’
    ../src/blowfish.cc:424: error: expected `;' before ‘datal’
    ../src/blowfish.cc:425: error: expected `;' before ‘datar’
    ../src/blowfish.cc:427: error: ‘j’ was not declared in this scope
    ../src/blowfish.cc:428: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc:430: error: ‘temp’ was not declared in this scope
    ../src/blowfish.cc:430: error: ‘key’ was not declared in this scope
    ../src/blowfish.cc:430: error: ‘keybytes’ was not declared in this scope
    ../src/blowfish.cc:430: error: ‘Blowfish_stream2word’ was not declared in this scope
    ../src/blowfish.cc:431: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:431: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:435: error: ‘datal’ was not declared in this scope
    ../src/blowfish.cc:436: error: ‘datar’ was not declared in this scope
    ../src/blowfish.cc:440: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:441: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:445: error: ‘k’ was not declared in this scope
    ../src/blowfish.cc:448: error: ‘struct BlowfishContext’ has no member named ‘S’
    ../src/blowfish.cc:449: error: ‘struct BlowfishContext’ has no member named ‘S’
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:456: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/blowfish.cc:457: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/blowfish.cc: In function ‘void Blowfish_expandstate(blf_ctx*, int)’:
    ../src/blowfish.cc:459: error: ‘u_int16_t’ was not declared in this scope
    ../src/blowfish.cc:459: error: expected `;' before ‘i’
    ../src/blowfish.cc:460: error: expected `;' before ‘j’
    ../src/blowfish.cc:461: error: expected `;' before ‘k’
    ../src/blowfish.cc:462: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:462: error: expected `;' before ‘temp’
    ../src/blowfish.cc:463: error: expected `;' before ‘datal’
    ../src/blowfish.cc:464: error: expected `;' before ‘datar’
    ../src/blowfish.cc:466: error: ‘j’ was not declared in this scope
    ../src/blowfish.cc:467: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc:469: error: ‘temp’ was not declared in this scope
    ../src/blowfish.cc:469: error: ‘key’ was not declared in this scope
    ../src/blowfish.cc:469: error: ‘keybytes’ was not declared in this scope
    ../src/blowfish.cc:469: error: ‘Blowfish_stream2word’ was not declared in this scope
    ../src/blowfish.cc:470: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:470: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:474: error: ‘datal’ was not declared in this scope
    ../src/blowfish.cc:475: error: ‘datar’ was not declared in this scope
    ../src/blowfish.cc:477: error: ‘data’ was not declared in this scope
    ../src/blowfish.cc:477: error: ‘databytes’ was not declared in this scope
    ../src/blowfish.cc:477: error: ‘Blowfish_stream2word’ was not declared in this scope
    ../src/blowfish.cc:481: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:482: error: ‘struct BlowfishContext’ has no member named ‘P’
    ../src/blowfish.cc:486: error: ‘k’ was not declared in this scope
    ../src/blowfish.cc:487: error: ‘data’ was not declared in this scope
    ../src/blowfish.cc:487: error: ‘databytes’ was not declared in this scope
    ../src/blowfish.cc:487: error: ‘Blowfish_stream2word’ was not declared in this scope
    ../src/blowfish.cc:491: error: ‘struct BlowfishContext’ has no member named ‘S’
    ../src/blowfish.cc:492: error: ‘struct BlowfishContext’ has no member named ‘S’
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:499: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/blowfish.cc:499: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/blowfish.cc: In function ‘void blf_key(blf_ctx*, int)’:
    ../src/blowfish.cc:505: error: ‘k’ was not declared in this scope
    ../src/blowfish.cc:505: error: ‘len’ was not declared in this scope
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:509: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc:509: error: ‘u_int16_t’ has not been declared
    ../src/blowfish.cc: In function ‘void blf_enc(blf_ctx*, int*, int)’:
    ../src/blowfish.cc:511: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:511: error: ‘d’ was not declared in this scope
    ../src/blowfish.cc:512: error: ‘u_int16_t’ was not declared in this scope
    ../src/blowfish.cc:512: error: expected `;' before ‘i’
    ../src/blowfish.cc:515: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:522: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc:522: error: ‘u_int16_t’ has not been declared
    ../src/blowfish.cc: In function ‘void blf_dec(blf_ctx*, int*, int)’:
    ../src/blowfish.cc:524: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:524: error: ‘d’ was not declared in this scope
    ../src/blowfish.cc:525: error: ‘u_int16_t’ was not declared in this scope
    ../src/blowfish.cc:525: error: expected `;' before ‘i’
    ../src/blowfish.cc:528: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:535: error: ‘u_int8_t’ has not been declared
    ../src/blowfish.cc:535: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc: In function ‘void blf_ecb_encrypt(blf_ctx*, int*, int)’:
    ../src/blowfish.cc:537: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:537: error: expected `;' before ‘l’
    ../src/blowfish.cc:538: error: expected `;' before ‘i’
    ../src/blowfish.cc:540: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc:541: error: ‘l’ was not declared in this scope
    ../src/blowfish.cc:542: error: ‘r’ was not declared in this scope
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:557: error: ‘u_int8_t’ has not been declared
    ../src/blowfish.cc:557: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc: In function ‘void blf_ecb_decrypt(blf_ctx*, int*, int)’:
    ../src/blowfish.cc:559: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:559: error: expected `;' before ‘l’
    ../src/blowfish.cc:560: error: expected `;' before ‘i’
    ../src/blowfish.cc:562: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc:563: error: ‘l’ was not declared in this scope
    ../src/blowfish.cc:564: error: ‘r’ was not declared in this scope
    ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:579: error: ‘u_int8_t’ has not been declared
    ../src/blowfish.cc:579: error: ‘u_int8_t’ has not been declared
    ../src/blowfish.cc:579: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc: In function ‘void blf_cbc_encrypt(blf_ctx*, int*, int*, int)’:
    ../src/blowfish.cc:581: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:581: error: expected `;' before ‘l’
    ../src/blowfish.cc:582: error: expected `;' before ‘i’
    ../src/blowfish.cc:584: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc:585: error: ‘j’ was not declared in this scope
    ../src/blowfish.cc:587: error: ‘l’ was not declared in this scope
    ../src/blowfish.cc:588: error: ‘r’ was not declared in this scope
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:25,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/ev.h:146:21: error: signal.h: No such file or directory
    /usr/local/Cellar/node/0.4.7/include/node/ev.h:155:23: error: ../src/blowfish.cc: At global scope:
    ../src/blowfish.cc:604: error: ‘u_int8_t’ has not been declaredsys/stat.h: No such file or directory

    ../src/blowfish.cc:604: error: ‘u_int8_t’ has not been declared
    ../src/blowfish.cc:604: error: ‘u_int32_t’ has not been declared
    ../src/blowfish.cc: In function ‘void blf_cbc_decrypt(blf_ctx*, int*, int*, int)’:
    ../src/blowfish.cc:606: error: ‘u_int32_t’ was not declared in this scope
    ../src/blowfish.cc:606: error: expected `;' before ‘l’
    ../src/blowfish.cc:607: error: ‘u_int8_t’ was not declared in this scope
    ../src/blowfish.cc:607: error: ‘iv’ was not declared in this scope
    ../src/blowfish.cc:608: error: expected `;' before ‘i’
    ../src/blowfish.cc:612: error: ‘i’ was not declared in this scope
    ../src/blowfish.cc:613: error: ‘l’ was not declared in this scope
    ../src/blowfish.cc:614: error: ‘r’ was not declared in this scope
    ../src/blowfish.cc:624: error: ‘j’ was not declared in this scope
    ../src/blowfish.cc:629: error: ‘l’ was not declared in this scope
    ../src/blowfish.cc:630: error: ‘r’ was not declared in this scope
    ../src/blowfish.cc:640: error: ‘j’ was not declared in this scope
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:26,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:48:23: error: sys/types.h: No such file or directory
    In file included from /usr/local/Cellar/node/0.4.7/include/node/v8.h:41,
                     from /usr/local/Cellar/node/0.4.7/include/node/node.h:27,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/v8stdint.h:33:19: error: stdio.h: No such file or directory
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:31,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:26:20: error: assert.h: No such file or directory
    ../src/bcrypt_node.cc:33:19: error: ctype.h: No such file or directory
    ../src/bcrypt_node.cc:34:20: error: string.h: No such file or directory
    ../src/bcrypt_node.cc:37:20: error: stdlib.h: No such file or directory
    ../src/bcrypt_node.cc:38:26: error: openssl/rand.h: No such file or directory
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:25,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/ev.h:366: error: field ‘prev’ has incomplete type
    /usr/local/Cellar/node/0.4.7/include/node/ev.h:367: error: field ‘attr’ has incomplete type
    /usr/local/Cellar/node/0.4.7/include/node/ev.h:443: error: ISO C++ forbids declaration of ‘sig_atomic_t’ with no type
    /usr/local/Cellar/node/0.4.7/include/node/ev.h:443: error: expected ‘;’ before ‘volatile’
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:26,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:122: error: ‘ino_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:197: error: ‘ssize_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:198: error: ‘off_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:276: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:278: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:279: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:280: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:284: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:285: error: ‘mode_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:286: error: ‘uid_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:286: error: ‘gid_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:288: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:289: error: ‘mode_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:291: error: ‘off_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:292: error: ‘uid_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:292: error: ‘gid_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:293: error: ‘mode_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:294: error: ‘mode_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:302: error: ‘mode_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:302: error: ‘dev_t’ has not been declared
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:341: error: ‘ssize_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:347: error: ‘ssize_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/eio.h:348: error: ‘ssize_t’ does not name a type
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:27,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/v8.h:723: error: ‘FILE’ has not been declared
    In file included from /usr/local/Cellar/node/0.4.7/include/node/node.h:31,
                     from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h: In destructor ‘virtual node::ObjectWrap::~ObjectWrap()’:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:39: error: ‘assert’ was not declared in this scope
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h: In static member function ‘static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>)’:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:50: error: there are no arguments to ‘assert’ that depend on a template parameter, so a declaration of ‘assert’ must be available
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:50: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:51: error: there are no arguments to ‘assert’ that depend on a template parameter, so a declaration of ‘assert’ must be available
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h: In member function ‘void node::ObjectWrap::Wrap(v8::Handle<v8::Object>)’:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:60: error: ‘assert’ was not declared in this scope
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h: In member function ‘virtual void node::ObjectWrap::Ref()’:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:77: error: ‘assert’ was not declared in this scope
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h: In member function ‘virtual void node::ObjectWrap::Unref()’:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:92: error: ‘assert’ was not declared in this scope
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h: In static member function ‘static void node::ObjectWrap::WeakCallback(v8::Persistent<v8::Value>, void*)’:
    /usr/local/Cellar/node/0.4.7/include/node/node_object_wrap.h:105: error: ‘assert’ was not declared in this scope
    In file included from ../src/bcrypt_node.cc:31:
    /usr/local/Cellar/node/0.4.7/include/node/node.h: At global scope:
    /usr/local/Cellar/node/0.4.7/include/node/node.h:77: error: ‘ssize_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/node.h:81: error: ‘ssize_t’ does not name a type
    /usr/local/Cellar/node/0.4.7/include/node/node.h: In function ‘v8::Persistent<v8::Function>* node::cb_unwrap(void*)’:
    /usr/local/Cellar/node/0.4.7/include/node/node.h:120: error: ‘assert’ was not declared in this scope
    In file included from ../src/bcrypt_node.cc:40:
    ../src/node_blf.h: At global scope:
    ../src/node_blf.h:60: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:61: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:70: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:70: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:71: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:71: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:73: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:73: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:75: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:75: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:79: error: expected ‘,’ or ‘...’ before ‘*’ token
    ../src/node_blf.h:79: error: ISO C++ forbids declaration of ‘u_int8_t’ with no type
    ../src/node_blf.h:80: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:80: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:81: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:81: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:83: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:83: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:84: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:84: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:86: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:87: error: ‘u_int32_t’ has not been declared
    ../src/node_blf.h:90: error: ‘u_int32_t’ does not name a type
    ../src/node_blf.h:93: error: ‘u_int8_t’ was not declared in this scope
    ../src/node_blf.h:93: error: ‘u_int8_t’ was not declared in this scope
    ../src/node_blf.h:93: error: expected primary-expression before ‘)’ token
    ../src/node_blf.h:93: error: initializer expression list treated as compound expression
    ../src/node_blf.h:95: error: ‘u_int8_t’ has not been declared
    ../src/node_blf.h:95: error: ‘u_int16_t’ has not been declared
    ../src/node_blf.h:95: error: ‘u_int8_t’ has not been declared
    In file included from ../src/bcrypt_node.cc:41:
    ../src/bcrypt_node.h:31: error: ‘ssize_t’ does not name a type
    ../src/bcrypt_node.cc:72: error: ‘u_int8_t’ was not declared in this scope
    ../src/bcrypt_node.cc:72: error: ‘seed’ was not declared in this scope
    ../src/bcrypt_node.cc:72: error: expected primary-expression before ‘int’
    ../src/bcrypt_node.cc:72: error: initializer expression list treated as compound expression
    ../src/bcrypt_node.cc:72: error: expected ‘,’ or ‘;’ before ‘{’ token
    Waf: Leaving directory `/Users/jamiltao/nodejs/wrtsat/node_modules/bcrypt/build'
    Build failed:
     -> task failed (err #1): 
        {task: cxx bcrypt.cc -> bcrypt_1.o}
     -> task failed (err #1): 
        {task: cxx blowfish.cc -> blowfish_1.o}
     -> task failed (err #1): 
        {task: cxx bcrypt_node.cc -> bcrypt_node_1.o}
    npm ERR! error installing [email protected] Error: [email protected] install: `node-waf configure build`
    npm ERR! error installing [email protected] `sh "-c" "node-waf configure build"` 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:67:17)
    npm ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)
    npm ERR! [email protected] install: `node-waf configure build`
    npm ERR! `sh "-c" "node-waf configure build"` failed with 1
    npm ERR! 
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is most likely a problem with the bcrypt package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node-waf configure build
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls bcrypt
    npm ERR! There is likely additional logging output above.
    npm ERR! 
    npm ERR! System Darwin 11.0.0
    npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
    npm ERR! 
    npm ERR! Additional logging details can be found in:
    npm ERR!     /Users/jamiltao/nodejs/wrtsat/npm-debug.log
    npm not ok

Any ideas?

NPM install script issues?

I'm using http://c9.io cloud IDE. It's quite possible that it is just not up to par with what it should be. Anyways... I'd thought I'd share because all of the other modules installed correctly.

info [email protected] Failed to exec install script
ERR! error installing [email protected] { stack: [Getter/Setter],
ERR! error installing [email protected]   arguments: undefined,
ERR! error installing [email protected]   type: undefined,
ERR! error installing [email protected]   message: '[email protected] install: `make build`\n`sh "-c" "make build"` failed with 1',
ERR! error installing [email protected]   errno: {},
ERR! error installing [email protected]   pkgid: '[email protected]',
ERR! error installing [email protected]   stage: 'install',
ERR! error installing [email protected]   script: 'make build',
ERR! error installing [email protected]   pkgname: 'bcrypt' }
verbose from cache /mnt/ws/users/erik5388/62587/eco/node_modules/bcrypt/package.json
info preuninstall [email protected]
info uninstall [email protected]
info unbuild [email protected] [ false,
info unbuild [email protected]   '/home/ide_erik5388/workspaces/npm_global/node_modules',
info unbuild [email protected]   '/mnt/ws/users/erik5388/62587/eco/node_modules' ]
info postuninstall [email protected]
verbose mkdir done: /home/ide_erik5388/workspaces/npm_cache/qs
verbose GET vargs/0.1.0
verbose raw, before any munging vargs/0.1.0
verbose url resolving [ 'http://registry.npmjs.org/', './vargs/0.1.0' ]
verbose url resolved http://registry.npmjs.org/vargs/0.1.0
verbose url parsed { protocol: 'http:',
verbose url parsed   slashes: true,
verbose url parsed   host: 'registry.npmjs.org',
verbose url parsed   hostname: 'registry.npmjs.org',
verbose url parsed   pathname: '/vargs/0.1.0',
verbose url parsed   href: 'http://registry.npmjs.org/vargs/0.1.0' }
verbose mkdir done: /home/ide_erik5388/workspaces/npm_cache/mkdirp/0.0.7
verbose GET qs/0.3.1
verbose raw, before any munging qs/0.3.1
verbose url resolving [ 'http://registry.npmjs.org/', './qs/0.3.1' ]
verbose url resolved http://registry.npmjs.org/qs/0.3.1
verbose url parsed { protocol: 'http:',
verbose url parsed   slashes: true,
verbose url parsed   host: 'registry.npmjs.org',
verbose url parsed   hostname: 'registry.npmjs.org',
verbose url parsed   pathname: '/qs/0.3.1',
verbose url parsed   href: 'http://registry.npmjs.org/qs/0.3.1' }
verbose bin dist [ '0.4-sunos-5.11',
verbose bin dist   { shasum: 'd89b4f0e4c3e5e5ca54235931675e094fe1a5072',
verbose bin dist     tarball: 'http://registry.npmjs.org/mkdirp/-/mkdirp-0.0.7.tgz' } ]
verbose addRemoteTarball [ 'http://registry.npmjs.org/mkdirp/-/mkdirp-0.0.7.tgz',
verbose addRemoteTarball   'd89b4f0e4c3e5e5ca54235931675e094fe1a5072' ]
verbose mkdir done: /tmp/npm-1318095796706/1318095802401-0.736822388600558
info fetch http://registry.npmjs.org/mkdirp/-/mkdirp-0.0.7.tgz
verbose fetch to /tmp/npm-1318095796706/1318095802401-0.736822388600558/tmp.tgz
info installOne cb [email protected]
ERR! [email protected] install: `make build`
ERR! `sh "-c" "make build"` failed with 1
ERR! 
ERR! Failed at the [email protected] install script.
ERR! This is most likely a problem with the bcrypt package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR!     make build
ERR! You can get their info via:
ERR!     npm owner ls bcrypt
ERR! There is likely additional logging output above.
ERR! 
ERR! System SunOS 5.11
ERR! command "/home/cloud9/c9/support/node-c9-builds-v4/node-c9-sunos" "/home/ide_erik5388/workspaces/npm/bin/npm.js" "install"
verbose exit [ 1, true ]

Any thoughts?

installing on OSX

Sorry, with the other issue report I asked for help to install bcrypt.
I followed the instruction, but it requires to install npm before installing bcrypt.

I learned it's not for starter's with OSX as me. The whole story is very much frusturating and dimension more complicate as with WIN or Linux. Forgive me, but is that the "easy going with Apple OSX"?

Looking forward to get valuable help

Günter

Version 0.5.0: npm install fails on MacOS

Hi All,
I am trying installing bcrypt 0.5.0 using node 0.6.11 and npm 1.1.0 on MacOS 10.7.3 / Darwin 11.3.0 . The 'make build' command fails. This is what you see on the terminal, and this is the corresponding npm debug log.

The install script complains that it can't configure a c compiler, but all the checks it has just done are successful, as you can see below:

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 program gcc or cc           : /usr/bin/gcc-4.2 
/Users/giacecco/Documents/Projects/jour.no/faves/eclipse-workspace/journo-faves/node_modules/bcrypt/wscript:16: error: could not configure a c compiler!
make: *** [configure] Error 1

Any ideas? Thanks!

Giacecco

npm install fails on make build command (too few arguments to function)

I'm attempting an npm install bcrypt. I'm unable to compile, it appears. I'm seeing an error that states the following:

[3/4] cxx: src/bcrypt_node.cc -> build/Release/src/bcrypt_node_1.o
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::GenerateSalt(const v8::Arguments&)’:
../src/bcrypt_node.cc:274:69: error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, eio_cb, void*, eio_channel*)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::Encrypt(const v8::Arguments&)’:
../src/bcrypt_node.cc:370:69: error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, eio_cb, void*, eio_channel*)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::Compare(const v8::Arguments&)’:
../src/bcrypt_node.cc:475:69: error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, eio_cb, void*, eio_channel*)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
Waf: Leaving directory `/home/ryan/node_modules/bcrypt/build'
Build failed:  -> task failed (err #1):
        {task: cxx bcrypt_node.cc -> bcrypt_node_1.o}
make: *** [compile] Error 1

I'm on Ubuntu, using GNU Make 3.81, with the libssl-dev headers installed. I am using Nodejs v0.7.0-pre with NPM 1.1.0-alpha-6. I'm not familiar enough with bcrypt or node to be able to actually check the C++ code for you. If I could, I would. :(

Entire npm log below:

λ ~/sites/litigance/lib/ master* npm install bcrypt

> [email protected] install /home/ryan/node_modules/bcrypt
> make build

rm -f bcrypt_lib.node
rm -Rf build
node-waf configure
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 program gcc or cc           : /usr/bin/gcc
Checking for gcc                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /usr/local
Checking for function RAND_bytes         : not found
'configure' finished successfully (0.196s)
node-waf build
Waf: Entering directory `/home/ryan/node_modules/bcrypt/build'
[1/4] cxx: src/blowfish.cc -> build/Release/src/blowfish_1.o
[2/4] cxx: src/bcrypt.cc -> build/Release/src/bcrypt_1.o
[3/4] cxx: src/bcrypt_node.cc -> build/Release/src/bcrypt_node_1.o
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::GenerateSalt(const v8::Arguments&)’:
../src/bcrypt_node.cc:274:69: error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, eio_cb, void*, eio_channel*)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::Encrypt(const v8::Arguments&)’:
../src/bcrypt_node.cc:370:69: error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, eio_cb, void*, eio_channel*)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::Compare(const v8::Arguments&)’:
../src/bcrypt_node.cc:475:69: error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, eio_cb, void*, eio_channel*)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
Waf: Leaving directory `/home/ryan/node_modules/bcrypt/build'
Build failed:  -> task failed (err #1):
        {task: cxx bcrypt_node.cc -> bcrypt_node_1.o}
make: *** [compile] Error 1
npm ERR! error installing [email protected] Error: [email protected] install: `make build`
npm ERR! error installing [email protected] `sh "-c" "make build"` failed with 2
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:70:17)
npm ERR! error installing [email protected]     at maybeExit (child_process.js:367:16)
npm ERR! error installing [email protected]     at Process.onexit (child_process.js:403:5)
npm ERR! [email protected] install: `make build`
npm ERR! `sh "-c" "make build"` failed with 2
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make build
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.0.0-12-server
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /home/ryan/sites/litigance/lib
npm ERR! node -v v0.7.0-pre
npm ERR! npm -v 1.1.0-alpha-6
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `make build`
npm ERR! message `sh "-c" "make build"` failed with 2
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ryan/sites/litigance/lib/npm-debug.log
npm not ok

Deployment Issue (invalid ELF header)

Hey guys, I'm trying to deploy an app that makes use of bcrypt. My local setup runs fine, but when deployed to server I'm bumping into the following error:

Error: /home/app/node_modules/bcrypt/build/default/bcrypt_lib.node: invalid ELF header
    at Object..node (module.js:416:11)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at require (module.js:348:19)
    at Object.<anonymous> (/home/app/node_modules/bcrypt/bcrypt.js:1:80)
    at Module._compile (module.js:404:26)
    at Object..js (module.js:410:10)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at require (module.js:348:19)

Both are using node v0.4.5. Any ideas as to what could be causing this?

Cheers,
Greg

Make functions async.

BCrypt, per the algo, can take some time. The functions should be async for less suck.

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.