node.js - Error installing bcrypt with npm -


i'm unable install bcrypt using npm on machine because encounter following errors. have been troubleshooting issue without luck. can recommend steps diagnose or fix problem can run npm install bcrypt successfully?

someones-macbook:node_modules cody$ npm install bcrypt npm warn package.json grunt-contrib-htmlmin@0.1.3 no readme data | > bcrypt@0.7.7 install /applications/mamp/htdocs/richintime/ultimate-seed/node_modules/bcrypt > node-gyp rebuild  child_process: customfds option deprecated, use stdio instead.   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 ../src/bcrypt_node.cc:118:18: error: no member named 'dispose' in 'v8::persistent<v8::function, v8::noncopyablepersistenttraits<v8::function>       >'         callback.dispose();         ~~~~~~~~ ^ ../src/bcrypt_node.cc:202:19: error: unknown type name 'uv_work_t' void gensaltasync(uv_work_t* req) {                   ^ ../src/bcrypt_node.cc:219:24: error: unknown type name 'uv_work_t' void gensaltasyncafter(uv_work_t* req) {                        ^ ../src/bcrypt_node.cc:220:17: error: calling protected constructor of class 'v8::handlescope'     handlescope scope;                 ^ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: note: declared protected here   v8_inline handlescope() {}             ^ ../src/bcrypt_node.cc:228:44: error: no member named 'new' in 'v8::string'         argv[0] = exception::error(string::new(baton->error.c_str()));                                    ~~~~~~~~^ ../src/bcrypt_node.cc:229:19: error: no matching function call 'undefined'         argv[1] = undefined();                   ^~~~~~~~~ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate function not viable: requires single argument 'isolate', no       arguments provided   friend handle<primitive> undefined(isolate* isolate);                            ^ ../src/bcrypt_node.cc:232:19: error: no matching function call 'undefined'         argv[0] = undefined();                   ^~~~~~~~~ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate function not viable: requires single argument 'isolate', no       arguments provided   friend handle<primitive> undefined(isolate* isolate);                            ^ ../src/bcrypt_node.cc:238:20: error: member reference type 'v8::persistent<v8::function>' not pointer; maybe meant use '.'?     baton->callback->call(context::getcurrent()->global(), 2, argv);     ~~~~~~~~~~~~~~~^~                    . ../src/bcrypt_node.cc:238:22: error: no member named 'call' in 'v8::persistent<v8::function, v8::noncopyablepersistenttraits<v8::function> >'     baton->callback->call(context::getcurrent()->global(), 2, argv);     ~~~~~~~~~~~~~~~  ^ ../src/bcrypt_node.cc:238:36: error: no member named 'getcurrent' in 'v8::context'     baton->callback->call(context::getcurrent()->global(), 2, argv);                           ~~~~~~~~~^ ../src/bcrypt_node.cc:246:34: error: unknown type name 'arguments'; did mean 'v8::internal::arguments'? handle<value> generatesalt(const arguments &args) {                                  ^~~~~~~~~                                  v8::internal::arguments /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::arguments' declared here class arguments;       ^ ../src/bcrypt_node.cc:247:17: error: calling protected constructor of class 'v8::handlescope'     handlescope scope;                 ^ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: note: declared protected here   v8_inline handlescope() {}             ^ ../src/bcrypt_node.cc:249:32: error: type 'const v8::internal::arguments' not provide subscript operator     const ssize_t rounds = args[0]->int32value();                            ~~~~^~ ../src/bcrypt_node.cc:250:30: error: type 'const v8::internal::arguments' not provide subscript operator     const int rand_len = args[1]->int32value();                          ~~~~^~ ../src/bcrypt_node.cc:251:58: error: type 'const v8::internal::arguments' not provide subscript operator     local<function> callback = local<function>::cast(args[2]);                                                      ~~~~^~ ../src/bcrypt_node.cc:255:45: error: 'new' private member of 'v8::persistentbase<v8::function>'     baton->callback = persistent<function>::new(callback);                                             ^ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:572:23: note: declared private here   v8_inline static t* new(isolate* isolate, t* that);                       ^ ../src/bcrypt_node.cc:255:57: error: few arguments function call, expected 2, have 1     baton->callback = persistent<function>::new(callback);                       ~~~~~~~~~~~~~~~~~~~~~~~~~         ^ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8.h:572:3: note: 'new' declared here   v8_inline static t* new(isolate* isolate, t* that);   ^ /users/cody/.node-gyp/0.12.0/deps/v8/include/v8config.h:289:20: note: expanded macro 'v8_inline' # define v8_inline inline __attribute__((always_inline))                    ^ ../src/bcrypt_node.cc:259:5: error: unknown type name 'uv_work_t'     uv_work_t* req = new uv_work_t;     ^ ../src/bcrypt_node.cc:259:26: error: unknown type name 'uv_work_t'     uv_work_t* req = new uv_work_t;                          ^ fatal error: many errors emitted, stopping [-ferror-limit=] 20 errors generated. make: *** [release/obj.target/bcrypt_lib/src/bcrypt_node.o] error 1 gyp err! build error  gyp err! stack error: `make` failed exit code: 2 gyp err! stack     @ childprocess.onexit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp err! stack     @ childprocess.emit (events.js:110:17) gyp err! stack     @ process.childprocess._handle.onexit (child_process.js:1067:12) gyp err! system darwin 13.4.0 gyp err! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp err! cwd /applications/mamp/htdocs/richintime/ultimate-seed/node_modules/bcrypt gyp err! node -v v0.12.0 gyp err! node-gyp -v v1.0.2 gyp err! not ok  npm err! darwin 13.4.0 npm err! argv "node" "/usr/local/bin/npm" "install" "bcrypt" npm err! node v0.12.0 npm err! npm  v2.7.1 npm err! code elifecycle  npm err! bcrypt@0.7.7 install: `node-gyp rebuild` npm err! exit status 1 npm err!  npm err! failed @ bcrypt@0.7.7 install script 'node-gyp rebuild'. npm err! problem bcrypt package, npm err! not npm itself. npm err! tell author fails on system: npm err!     node-gyp rebuild 

the easy solution switch "bcrypt" npm module bycryptjs or bcrypt-nodejs. it's exact same api, pure js no native add-ons deal with.

npm install --save bcryptjs && npm uninstall --save bcrypt 

then change require calls "bcryptjs", code otherwise can unchanged.

long term, suspect @ moment bcrypt may not ready node v0.12.0 yet, if not updated , ready.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -