artursgirons/beyondpad

issue with bcrypt

Closed this issue · 3 comments

I tried executing npm install and it stopped with this message. any ideas?

bcrypt@0.8.2 install /var/www/notebook.jonathanchin.com/node_modules/bcrypt
node-gyp rebuild
make: Entering directory '/var/www/notebook.jonathanchin.com/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../node_modules/nan/nan_new.h:190:0,
from ../node_modules/nan/nan.h:80,
from ../src/bcrypt_node.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static NanIntern::FactoryBasev8::Signature::return_t NanIntern::Factoryv8::Signature::New(NanIntern::Factoryv8::Signature::FTH, int, NanIntern::Factoryv8::Signature::FTH_)’:
../node_modules/nan/nan_implementation_12_inl.h:181:76: error: no matching function for call to ‘v8::Signature::New(v8::Isolate_, NanIntern::Factoryv8::Signature::FTH&, int&, NanIntern::Factoryv8::Signature::FTH_&)’
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
^
In file included from /usr/include/nodejs/src/node.h:42:0,
from ../node_modules/nan/nan.h:24,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:4675:27: note: candidate: static v8::Localv8::Signature v8::Signature::New(v8::Isolate_, v8::Localv8::FunctionTemplate)
static Local New(
^
/usr/include/nodejs/deps/v8/include/v8.h:4675:27: note: candidate expects 2 arguments, 4 provided
In file included from ../src/bcrypt_node.cc:1:0:
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:171:25: error: redefinition of ‘template v8::Local NanEnsureLocal(v8::Local)’
NAN_INLINE v8::Local NanEnsureLocal(v8::Local val) {
^
../node_modules/nan/nan.h:166:25: note: ‘template v8::Local NanEnsureLocal(v8::Handle)’ previously declared here
NAN_INLINE v8::Local NanEnsureLocal(v8::Handle val) {
^
../node_modules/nan/nan.h:564:13: error: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^
../node_modules/nan/nan.h:564:35: error: expected ‘,’ or ‘...’ before ‘callback’
, node::smalloc::FreeCallback callback
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(char
, size_t, int)’:
../node_modules/nan/nan.h:568:50: error: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../node_modules/nan/nan.h:568:60: error: ‘hint’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(const char
, uint32_t)’:
../node_modules/nan/nan.h:575:67: error: no matching function for call to ‘New(v8::Isolate
, const char&, uint32_t&)’
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
In file included from ../node_modules/nan/nan.h:25:0,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/src/node_buffer.h:31:40: note: candidate: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate_, v8::Localv8::String, node::encoding)
NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate_ isolate,
^
/usr/include/nodejs/src/node_buffer.h:31:40: note: conversion of argument 3 would be ill-formed:
In file included from ../src/bcrypt_node.cc:1:0:
../node_modules/nan/nan.h:575:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
In file included from ../node_modules/nan/nan.h:25:0,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/src/node_buffer.h:43:40: note: candidate: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate_, char_, size_t)
NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate,
^
/usr/include/nodejs/src/node_buffer.h:43:40: note: conversion of argument 2 would be ill-formed:
In file included from ../src/bcrypt_node.cc:1:0:
../node_modules/nan/nan.h:575:67: error: invalid conversion from ‘const char_’ to ‘char_’ [-fpermissive]
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:579:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocalv8::Object’ to ‘v8::Localv8::Object’
return node::Buffer::New(v8::Isolate::GetCurrent(), size);
^
../node_modules/nan/nan.h: In function ‘v8::Localv8::Object NanBufferUse(char_, uint32_t)’:
../node_modules/nan/nan.h:586:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
../src/bcrypt_node.cc: In member function ‘virtual void {anonymous}::SaltAsyncWorker::HandleOKCallback()’:
../src/bcrypt_node.cc:85:59: warning: ‘v8::Localv8::Value node::Encode(const void_, size_t, node::encoding)’ is deprecated: Use Encode(isolate, ...) [-Wdeprecated-declarations]
argv[1] = Encode(salt.c_str(), salt.size(), BINARY);
^
In file included from ../node_modules/nan/nan.h:24:0,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/src/node.h:299:45: note: declared here
inline v8::Localv8::Value Encode(
^
/usr/include/nodejs/src/node.h:66:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^
In file included from ../src/bcrypt_node.cc:1:0:
../src/bcrypt_node.cc: In function ‘void {anonymous}::GenerateSaltSync(const v8::FunctionCallbackInfov8::Value&)’:
../src/bcrypt_node.cc:139:53: warning: ‘v8::Localv8::Value node::Encode(const void_, size_t, node::encoding)’ is deprecated: Use Encode(isolate, ...) [-Wdeprecated-declarations]
NanReturnValue(Encode(salt, strlen(salt), BINARY));
^
../node_modules/nan/nan.h:306:65: note: in definition of macro ‘NanReturnValue’

define NanReturnValue(value) return args.GetReturnValue().Set(value)

                                                             ^

In file included from ../node_modules/nan/nan.h:24:0,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/src/node.h:299:45: note: declared here
inline v8::Localv8::Value Encode(
^
/usr/include/nodejs/src/node.h:66:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^
../src/bcrypt_node.cc: In member function ‘virtual void {anonymous}::EncryptAsyncWorker::HandleOKCallback()’:
../src/bcrypt_node.cc:172:67: warning: ‘v8::Localv8::Value node::Encode(const void_, size_t, node::encoding)’ is deprecated: Use Encode(isolate, ...) [-Wdeprecated-declarations]
argv[1] = Encode(output.c_str(), output.size(), BINARY);
^
In file included from ../node_modules/nan/nan.h:24:0,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/src/node.h:299:45: note: declared here
inline v8::Localv8::Value Encode(
^
/usr/include/nodejs/src/node.h:66:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^
In file included from ../src/bcrypt_node.cc:1:0:
../src/bcrypt_node.cc: In function ‘void {anonymous}::EncryptSync(const v8::FunctionCallbackInfov8::Value&)’:
../src/bcrypt_node.cc:223:61: warning: ‘v8::Localv8::Value node::Encode(const void_, size_t, node::encoding)’ is deprecated: Use Encode(isolate, ...) [-Wdeprecated-declarations]
NanReturnValue(Encode(bcrypted, strlen(bcrypted), BINARY));
^
../node_modules/nan/nan.h:306:65: note: in definition of macro ‘NanReturnValue’

define NanReturnValue(value) return args.GetReturnValue().Set(value)

                                                             ^

In file included from ../node_modules/nan/nan.h:24:0,
from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/src/node.h:299:45: note: declared here
inline v8::Localv8::Value Encode(
^
/usr/include/nodejs/src/node.h:66:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^
bcrypt_lib.target.mk:92: recipe for target 'Release/obj.target/bcrypt_lib/src/bcrypt_node.o' failed
make: *_* [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory '/var/www/notebook.jonathanchin.com/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-18-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/notebook.jonathanchin.com/node_modules/bcrypt
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Linux 4.4.0-18-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! bcrypt@0.8.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/notebook.jonathanchin.com/npm-debug.log

windows? if so you need to google how to install bcrytp there, there was some stuff with expicitly specifying compiler for bcrypt VS2005 or something.

Nope, Linux. It might be related to the amount of ram I have allocated to
my system but I think I bumped it up to 2 gigs and that didn't solve it.
(Bumping up the ram solved similar npm problems on other projects).

I'm running Ubuntu 16.04 which may be another factor.
On Apr 18, 2016 10:06 AM, "Arturs Girons" notifications@github.com wrote:

windows? if so you need to google how to install bcrytp there, there was
some stuff with expicitly specifying compiler for bcrypt VS2005 or
something.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#3 (comment)

I got it working but had to use bcryptjs instead of bcrypt. I had to modify some of the source files too.

Also, it seems npm install didn't install the bson module correctly. serving server.js complained about 'mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/objectid'

I had to manually create those folders and copy the bson source there.