kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.5k stars 518 forks source link

bcrypt installation issue on windows 7 #155

Closed goldenrum closed 11 years ago

goldenrum commented 11 years ago

Hai guys, i'm having an issue installing bcrypt on windows 7 please see below the specs of my environment and error logs. Please help point me to the right direction..

I have the following installed: -windows 7 -node 0.10.0 32-bit -npm version 1.2.14 -openssl 32 bit installed at C:\OpenSSL-Win32 -node-gyp@0.8.5 -visual studio c++ express versions 2008, 2010, and 2012 -python 2.7.3 32-bit

FYI (may or may not be relevant): node-gyp failed me when I tried to install bson version 0.1.8 using the command: "npm install bson@latest", but installation worked with "npm install bson@latest --msvs_version=110"

Below are the logs for two different commands that I used ("npm install bcrypt" and "npm install bcrypt --msvs_version=v110")

D:\Ben\Projects\myNode>npm install bcrypt npm http GET https://registry.npmjs.org/bcrypt npm http 304 https://registry.npmjs.org/bcrypt npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0

bcrypt@0.7.5 install D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp rebuild

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. blowfish.cc bcrypt.cc bcrypt_node.cc C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [D:\Ben\Projects\myNode\node_modules\bcrypt\build\bcrypt_lib.vc xproj] C:\Users\Owner.node-gyp\0.10.0\deps\v8\include\v8.h(184): warning C4506: no de finition for inline function 'v8::Persistent v8::Persistent::New(v8::Hand le)' [D:\Ben\Projects\myNode\node_modules\bcrypt\build\bcrypt_lib.vcxproj] with [ T=v8::Object ] Creating library D:\Ben\Projects\myNode\node_modules\bcrypt\build\Releas e\bcrypt_lib.lib and object D:\Ben\Projects\myNode\node_modules\bcrypt\buil d\Release\bcrypt_lib.exp Generating code Finished generating code bcrypt_lib.vcxproj -> D:\Ben\Projects\myNode\node_modules\bcrypt\build\Rele ase\bcrypt_lib.node bcrypt@0.7.5 node_modules\bcrypt └── bindings@1.0.0

D:\Ben\Projects\myNode>npm install bcrypt --msvs_version=v110 npm http GET https://registry.npmjs.org/bcrypt npm http 304 https://registry.npmjs.org/bcrypt npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0

bcrypt@0.7.5 install D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp rebuild

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild Traceback (most recent call last): File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \gyp", line 18, in sys.exit(gyp.main(sys.argv[1:])) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gypinit.py", line 523, in main return gyp_main(args) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gypinit.py", line 499, in gyp_main options.circular_check) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gypinit.py", line 96, in Load generator.CalculateVariables(default_variables, params) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gyp\generator\msvs.py", line 1703, in CalculateVariables generator_flags.get('msvs_version', 'auto')) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gyp\MSVSVersion.py", line 359, in SelectVisualStudioVersion versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)

KeyError: 'v110' gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_ modules\npm\node_modules\node-gyp\lib\configure.js:416:16) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:754: 12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\Ben\Projects\myNode\node_modules\bcrypt gyp ERR! node -v v0.10.0 gyp ERR! node-gyp -v v0.8.5 gyp ERR! not ok npm ERR! bcrypt@0.7.5 install: node-gyp rebuild npm ERR! cmd "/c" "node-gyp rebuild" failed with 1 npm ERR! npm ERR! Failed at the bcrypt@0.7.5 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-gyp rebuild 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! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program File s (x86)\nodejs\nodemodules\npm\bin\npm-cli.js" "install" "bcrypt" "--msvs version=v110" npm ERR! cwd D:\Ben\Projects\myNode npm ERR! node -v v0.10.0 npm ERR! npm -v 1.2.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! D:\Ben\Projects\myNode\npm-debug.log npm ERR! not ok code 0

For the love of all that is good please help..

ncb000gt commented 11 years ago

At first glance this appears to be an issue in finding the msvs version you've specified. It seems to be something to do with gyp.

If you're looking for msvs 2010 try using --msvs_version=v100 if you're trying to use 2012 try --msvs_version=2012. Let us know if that works.

goldenrum commented 11 years ago

Appreciate the help! Using the above recommendations didn't yield good results. Strangely --msvs_version=2012 didn't work for other module installation (e.g. bson@0.1.8), but bson installation worked using --msvs_version=110 or --msvs_version=v110.

In bcrypt's case, using --msvs_version=2012 worked better than using --msvs_version=v110 but with warnings. Even though it's just a warning I'm not sure if I can expect the installed bcrypt to operate reliably. Using --msvs_version=v100 did not work.

Please refer below for the bcrypt's logs and bson's as well since the errors shared some similarities like ''warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle) .......'

The logs below are in the following order:

npm install bcrypt --msvs_version=v100 npm install bcrypt --msvs_version=2010 npm install bcrypt --msvs_version=2012 npm install bson --msvs_version=2012


D:\Ben\Projects\myNode>npm install bcrypt --msvs_version=v100 npm http GET https://registry.npmjs.org/bcrypt npm http 304 https://registry.npmjs.org/bcrypt npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0

bcrypt@0.7.5 install D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp rebuild

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild Traceback (most recent call last): File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \gyp", line 18, in sys.exit(gyp.main(sys.argv[1:])) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gypinit.py", line 523, in main return gyp_main(args) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gypinit.py", line 499, in gyp_main options.circular_check) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gypinit.py", line 96, in Load generator.CalculateVariables(default_variables, params) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gyp\generator\msvs.py", line 1703, in CalculateVariables generator_flags.get('msvs_version', 'auto')) File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp \pylib\gyp\MSVSVersion.py", line 359, in SelectVisualStudioVersion versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)

KeyError: 'v100' gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_ modules\npm\node_modules\node-gyp\lib\configure.js:416:16) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:754: 12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\Ben\Projects\myNode\node_modules\bcrypt gyp ERR! node -v v0.10.0 gyp ERR! node-gyp -v v0.8.5 gyp ERR! not ok npm ERR! bcrypt@0.7.5 install: node-gyp rebuild npm ERR! cmd "/c" "node-gyp rebuild" failed with 1 npm ERR! npm ERR! Failed at the bcrypt@0.7.5 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-gyp rebuild 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! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program File s (x86)\nodejs\nodemodules\npm\bin\npm-cli.js" "install" "bcrypt" "--msvs version=v100" npm ERR! cwd D:\Ben\Projects\myNode npm ERR! node -v v0.10.0 npm ERR! npm -v 1.2.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! D:\Ben\Projects\myNode\npm-debug.log npm ERR! not ok code 0


D:\Ben\Projects\myNode>npm install bcrypt --msvs_version=2010 npm http GET https://registry.npmjs.org/bcrypt npm http 304 https://registry.npmjs.org/bcrypt npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0

bcrypt@0.7.5 install D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp rebuild

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. blowfish.cc bcrypt.cc bcrypt_node.cc C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [D:\Ben\Projects\myNode\node_modules\bcrypt\build\bcrypt_lib.vc xproj] C:\Users\Owner.node-gyp\0.10.0\deps\v8\include\v8.h(184): warning C4506: no de finition for inline function 'v8::Persistent v8::Persistent::New(v8::Hand le)' [D:\Ben\Projects\myNode\node_modules\bcrypt\build\bcrypt_lib.vcxproj] with [ T=v8::Object ] Creating library D:\Ben\Projects\myNode\node_modules\bcrypt\build\Releas e\bcrypt_lib.lib and object D:\Ben\Projects\myNode\node_modules\bcrypt\buil d\Release\bcrypt_lib.exp Generating code Finished generating code bcrypt_lib.vcxproj -> D:\Ben\Projects\myNode\node_modules\bcrypt\build\Rele ase\bcrypt_lib.node bcrypt@0.7.5 node_modules\bcrypt └── bindings@1.0.0


D:\Ben\Projects\myNode>npm install bcrypt --msvs_version=2012 npm http GET https://registry.npmjs.org/bcrypt npm http 304 https://registry.npmjs.org/bcrypt npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0

bcrypt@0.7.5 install D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp rebuild

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. blowfish.cc bcrypt.cc bcrypt_node.cc C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\bcrypt_node.cc) [D:\Ben\Projects\myNode\node_modules\bc rypt\build\bcrypt_lib.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocnum(155): wa rning C4506: no definition for inline function 'v8::Persistent v8::Persisten t::New(v8::Handle)' [D:\Ben\Projects\myNode\node_modules\bcrypt\build\b crypt_lib.vcxproj] with T=v8::Object Creating library D:\Ben\Projects\myNode\node_modules\bcrypt\build\Releas e\bcrypt_lib.lib and object D:\Ben\Projects\myNode\node_modules\bcrypt\buil d\Release\bcrypt_lib.exp Generating code Finished generating code bcrypt_lib.vcxproj -> D:\Ben\Projects\myNode\node_modules\bcrypt\build\Rele ase\bcrypt_lib.node bcrypt@0.7.5 node_modules\bcrypt └── bindings@1.0.0


D:\Ben\Projects\myNode>npm install bson --msvs_version=2012 npm http GET https://registry.npmjs.org/bson npm http 304 https://registry.npmjs.org/bson

bson@0.1.8 install D:\Ben\Projects\myNode\node_modules\bson (node-gyp rebuild 2> builderror.log) || (exit 0)

D:\Ben\Projects\myNode\node_modules\bson>node "C:\Program Files (x86)\nodejs\n ode_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" r ebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. bson.cc C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [D:\Ben\Projects\myNode\node_modules\bson\build\bson.vcxproj] ..\ext\bson.cc(547): warning C4244: 'argument' : conversion from 'int64_t' to ' double', possible loss of data [D:\Ben\Projects\myNode\node_modules\bson\buil d\bson.vcxproj] C:\Users\Owner.node-gyp\0.10.0\deps\v8\include\v8.h(184): warning C4506: no de finition for inline function 'v8::Persistent v8::Persistent::New(v8::Hand le)' [D:\Ben\Projects\myNode\node_modules\bson\build\bson.vcxproj] with [ T=v8::Object ] C:\Users\Owner.node-gyp\0.10.0\deps\v8\include\v8.h(184): warning C4506: no de finition for inline function 'v8::Persistent v8::Persistent::New(v8::Hand le)' [D:\Ben\Projects\myNode\node_modules\bson\build\bson.vcxproj] with [ T=v8::FunctionTemplate ] Creating library D:\Ben\Projects\myNode\node_modules\bson\build\Release\ bson.lib and object D:\Ben\Projects\myNode\node_modules\bson\build\Release\ bson.exp Generating code Finished generating code bson.vcxproj -> D:\Ben\Projects\myNode\node_modules\bson\build\Release\bso n.node bson@0.1.8 node_modules\bson

TooTallNate commented 11 years ago

It seems like the output from npm install bcrypt --msvs_version=2012 was successful.

ncb000gt commented 11 years ago

Another note, and I'm a little out of my element on this one (LINUX 4 EVA), try --msvs_version=auto. I noticed this recommended elsewhere on the tubes.

ncb000gt commented 11 years ago

Also also, you might glean some insight by checking into https://github.com/TooTallNate/node-gyp/blob/master/gyp/pylib/gyp/MSVSVersion.py#L200:L265

ncb000gt commented 11 years ago

Also^3, https://github.com/TooTallNate/node-gyp/blob/master/gyp/pylib/gyp/MSVSVersion.py#L348:L356

defunctzombie commented 11 years ago

Closing as this does not appear to be a bcrypt issue.

goldenrum commented 11 years ago

@ncb000gt : yea I'm starting to figure out why windows is so disliked. --msvs_version=auto doesn't work and gave similar errors as posted in log below. And thanks for the pointers I'll take a look at the MSVSVersion.py file. Since @TooTallNate said it installed ok then i guess this is ok then.

@TooTallNate : Any idea if the warning from "npm install bcrypt --msvs_version=2012" will affect the performance of the bcrypt module? And would this be a node-gyp issue since this is closed?

@shtylman : kk

log:

D:\Ben\Projects\myNode>npm install bcrypt@latest --msvs_version=auto npm http GET https://registry.npmjs.org/bcrypt npm http 304 https://registry.npmjs.org/bcrypt npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0

bcrypt@0.7.5 install D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp rebuild

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp .Win32.Targets(518,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value i s selected. [D:\Ben\Projects\myNode\node_modules\bcrypt\build\bcrypt_lib.vcxp roj] gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\build.js:256:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:754: 12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\Ben\Projects\myNode\node_modules\bcrypt gyp ERR! node -v v0.10.0 gyp ERR! node-gyp -v v0.9.2 gyp ERR! not ok npm ERR! bcrypt@0.7.5 install: node-gyp rebuild npm ERR! cmd "/c" "node-gyp rebuild" failed with 1 npm ERR! npm ERR! Failed at the bcrypt@0.7.5 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-gyp rebuild 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! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program File s (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "bcrypt@latest" " --msvs_version=auto" npm ERR! cwd D:\Ben\Projects\myNode npm ERR! node -v v0.10.0 npm ERR! npm -v 1.2.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! D:\Ben\Projects\myNode\npm-debug.log npm ERR! not ok code 0

ncb000gt commented 11 years ago

As for performance and such. Outside of it not functioning correctly, being fast or slow should be irrelevant so long as it is constant. What I mean by this is that it shouldn't be faster or slower for different sized input, and in terms of compute speed, should be slow (slower with a higher cost factor).

In terms of seeing if it fails, hop into the node_modules/bcrypt directory and try running the tests...or, run them through npm with npm test bcrypt. That should give you some idea as to whether it will work or not.

goldenrum commented 11 years ago

hmmm unfortunately it didn't install correctly as @TooTallNate suggested by using npm install bcrypt --msvs_version=2012 since the test failed as seen below :(( What should I do.. should I just go for the crypt module? But the last update for that module is a year ago so being a newb I'm not sure if I should go for something unsupported like the crypt module so I would much rather use bcrypt.

D:\Ben\Projects\myNode\node_modules>npm test bcrypt

bcrypt@0.7.5 test D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp configure build && nodeunit test

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" configure build Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp .Win32.Targets(518,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value i s selected. [D:\Ben\Projects\myNode\node_modules\bcrypt\build\bcrypt_lib.vcxp roj] gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\build.js:256:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:754: 12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "configure" "build" gyp ERR! cwd D:\Ben\Projects\myNode\node_modules\bcrypt gyp ERR! node -v v0.10.0 gyp ERR! node-gyp -v v0.9.2 gyp ERR! not ok npm ERR! Test failed. See above for more details. npm ERR! not ok code 0

D:\Ben\Projects\myNode\node_modules>npm test bcrypt --msvs_version=2012

bcrypt@0.7.5 test D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp configure build && nodeunit test

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" configure build Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Creating library D:\Ben\Projects\myNode\node_modules\bcrypt\build\Releas e\bcrypt_lib.lib and object D:\Ben\Projects\myNode\node_modules\bcrypt\buil d\Release\bcrypt_lib.exp Generating code Finished generating code bcrypt_lib.vcxproj -> D:\Ben\Projects\myNode\node_modules\bcrypt\build\Rele ase\bcrypt_lib.node 'nodeunit' is not recognized as an internal or external command, operable program or batch file. npm ERR! Test failed. See above for more details. npm ERR! not ok code 0

ncb000gt commented 11 years ago

From your output it appears that the test failed because you don't have nodeunit, not because of bcrypt itself. Make sure that nodeunit is in the path and then try again.

goldenrum commented 11 years ago

It's like i'm doing alchemy.. one way or another things happen :D

The test thing is actually kinda cool. I got the following logs with a red colored text on "? test_hash_compare_empty_strings" so I'm guessing that's the only error. Would you say it's fine as long as I avoid inputting empty strings into the bcrypt functions?

Log:

D:\Ben\Projects\myNode\node_modules>npm test bcrypt --msvs_version=2012

bcrypt@0.7.5 test D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp configure build && nodeunit test

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" configure build Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Creating library D:\Ben\Projects\myNode\node_modules\bcrypt\build\Releas e\bcrypt_lib.lib and object D:\Ben\Projects\myNode\node_modules\bcrypt\buil d\Release\bcrypt_lib.exp Generating code Finished generating code bcrypt_lib.vcxproj -> D:\Ben\Projects\myNode\node_modules\bcrypt\build\Rele ase\bcrypt_lib.node

async ? test_salt_length ? test_salt_no_params ? test_salt_only_cb ? test_salt_rounds_is_string_number ? test_salt_rounds_is_NaN ? test_hash ? test_hash_rounds ? test_hash_empty_strings ? test_hash_no_params ? test_hash_one_param ? test_hash_not_hash_str ? test_hash_salt_validity ? test_verify_salt ? test_verify_salt_min_rounds ? test_verify_salt_max_rounds ? test_hash_compare ? test_hash_compare_empty_strings

Assertion Message: These hashes should be equal. AssertionError: These hashes should be equal. at Object.equal (D:\Ben\Projects\myNode\node_modules\nodeunit\lib\types.js :83:39) at D:\Ben\Projects\myNode\node_modules\bcrypt\test\async.js:132:20

? test_hash_compare_invalid_strings

deprecated DEPRECATION WARNING: gen_salt has been deprecated. Please use genSalt instea d. DEPRECATION WARNING: encrypt has been deprecated. Please use hash instead. ? test_encrypt DEPRECATION WARNING: gen_salt_sync has been deprecated. Please use genSaltSyn c instead. ? test_gen_salt_sync DEPRECATION WARNING: gen_salt_sync has been deprecated. Please use genSaltSyn c instead. DEPRECATION WARNING: encrypt_sync has been deprecated. Please use hashSync i nstead. DEPRECATION WARNING: compare_sync has been deprecated. Please use compareSync instead. DEPRECATION WARNING: compare_sync has been deprecated. Please use compareSync instead. ? test_encrypt_compare_sync DEPRECATION WARNING: gen_salt_sync has been deprecated. Please use genSaltSyn c instead. DEPRECATION WARNING: encrypt_sync has been deprecated. Please use hashSync i nstead. DEPRECATION WARNING: get_rounds has been deprecated. Please use getRounds in stead. ? test_get_rounds_sync

repetitions ? test_salt_length ? test_hash_length ? test_compare ? test_hash_and_compare

sync ? test_salt_length ? test_salt_no_params ? test_salt_rounds_is_string_number ? test_salt_rounds_is_NaN ? test_hash ? test_hash_rounds ? test_hash_empty_string ? test_hash_pw_no_params ? test_hash_pw_one_param ? test_hash_pw_not_hash_str ? test_hash_salt_validity ? test_verify_salt ? test_verify_salt_min_rounds ? test_verify_salt_max_rounds ? test_hash_compare ? test_hash_compare_empty_strings ? test_hash_compare_invalid_strings ? test_getRounds

FAILURES: 1/15064 assertions failed (29627ms) npm ERR! Test failed. See above for more details. npm ERR! not ok code 0

goldenrum commented 11 years ago

Ok, since this issue has not garnered much attention at present and in the past, can I assume exception handling is of lesser concern for bcrypt and other modules depending on node-gyp? And by looking what an inline function is it seems that the compiler might be smart enough to work around the issue so this shouldn't also be a problem I would think.

I magically hacked some files by referring to below github links to erase the inline function definition and exception handling complaints: https://github.com/brianmcd/contextify/issues/45 https://gist.github.com/TooTallNate/4021657

Though I am curious why such fixes haven't been employed yet? Is there something fundamentally wrong with my compiler and that it worked for other people just fine?

And also, I ran the nodeunit test again and that 1 error is still showing up so I'm just wondering if it's a bug from bcrypt or from my side? (i.e. red text on this test: "? test_hash_compare_empty_strings")

LOG:

D:\Ben\Projects\myNode\node_modules>npm test bcrypt --msvs_version=2012

bcrypt@0.7.5 test D:\Ben\Projects\myNode\node_modules\bcrypt node-gyp configure build && nodeunit test

D:\Ben\Projects\myNode\node_modules\bcrypt>node "C:\Program Files (x86)\nodejs \node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" configure build Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Creating library D:\Ben\Projects\myNode\node_modules\bcrypt\build\Releas e\bcrypt_lib.lib and object D:\Ben\Projects\myNode\node_modules\bcrypt\buil d\Release\bcrypt_lib.exp Generating code Finished generating code bcrypt_lib.vcxproj -> D:\Ben\Projects\myNode\node_modules\bcrypt\build\Rele ase\bcrypt_lib.node

async ? test_salt_length ? test_salt_no_params ? test_salt_only_cb ? test_salt_rounds_is_string_number ? test_salt_rounds_is_NaN ? test_hash ? test_hash_rounds ? test_hash_empty_strings ? test_hash_no_params ? test_hash_one_param ? test_hash_not_hash_str ? test_hash_salt_validity ? test_verify_salt ? test_verify_salt_min_rounds ? test_verify_salt_max_rounds ? test_hash_compare ? test_hash_compare_empty_strings

Assertion Message: These hashes should be equal. AssertionError: These hashes should be equal. at Object.equal (D:\Ben\Projects\myNode\node_modules\nodeunit\lib\types.js :83:39) at D:\Ben\Projects\myNode\node_modules\bcrypt\test\async.js:132:20

? test_hash_compare_invalid_strings

deprecated DEPRECATION WARNING: gen_salt has been deprecated. Please use genSalt instea d. DEPRECATION WARNING: encrypt has been deprecated. Please use hash instead. ? test_encrypt DEPRECATION WARNING: gen_salt_sync has been deprecated. Please use genSaltSyn c instead. ? test_gen_salt_sync DEPRECATION WARNING: gen_salt_sync has been deprecated. Please use genSaltSyn c instead. DEPRECATION WARNING: encrypt_sync has been deprecated. Please use hashSync i nstead. DEPRECATION WARNING: compare_sync has been deprecated. Please use compareSync instead. DEPRECATION WARNING: compare_sync has been deprecated. Please use compareSync instead. ? test_encrypt_compare_sync DEPRECATION WARNING: gen_salt_sync has been deprecated. Please use genSaltSyn c instead. DEPRECATION WARNING: encrypt_sync has been deprecated. Please use hashSync i nstead. DEPRECATION WARNING: get_rounds has been deprecated. Please use getRounds in stead. ? test_get_rounds_sync

repetitions ? test_salt_length ? test_hash_length ? test_compare ? test_hash_and_compare

sync ? test_salt_length ? test_salt_no_params ? test_salt_rounds_is_string_number ? test_salt_rounds_is_NaN ? test_hash ? test_hash_rounds ? test_hash_empty_string ? test_hash_pw_no_params ? test_hash_pw_one_param ? test_hash_pw_not_hash_str ? test_hash_salt_validity ? test_verify_salt ? test_verify_salt_min_rounds ? test_verify_salt_max_rounds ? test_hash_compare ? test_hash_compare_empty_strings ? test_hash_compare_invalid_strings ? test_getRounds

FAILURES: 1/15064 assertions failed (29416ms) npm ERR! Test failed. See above for more details. npm ERR! not ok code 0

ncb000gt commented 11 years ago

I'm not sure what you mean by "exception handling is of lesser concern for bcrypt". Warnings aren't all that concerning to us so long as it builds. If people see erratic behavior when running the lib that are caused by what the warnings note, then we'll take care of them. Otherwise, they can, usually, safely be ignored. Is that what you meant?

So, that red colored text just means that the test failed (with the obvious output stating so as you noted). The issue with the exception is that it is suggesting that the hashes are equal (the error message is wrong). Compare should return false if the hash to compare against is an empty string. I'm not sure currently why that would be failing for you though. I might be able to look at it a little later. For now you might want to investigate that code a little bit and see if you can find anything.

goldenrum commented 11 years ago

Yep, that's what I was blabbing about :D Then i can rest easy knowing that warnings like those might not be so bad.

Regarding the red colored text, I think that error could be trivial and could be taken care of by prevention, so I'll check it at a later time and let you know.

Thanks. Really appreciate your kind attentions.

TooTallNate commented 11 years ago

Ya, I think things are fine for you at this point. One failing test isn't so bad usually. Also the warnings are harmless. Ignore them.

On Friday, March 22, 2013, goldenrum wrote:

Yep, that's what I was blabbing about :D Then i can rest easy knowing that warnings like those might not be so bad.

Regarding the red colored text, I think that error could be trivial and could be taken care of by prevention, so I'll check it at a later time and let you know.

Thanks. Really appreciate your kind attentions.

— Reply to this email directly or view it on GitHubhttps://github.com/ncb000gt/node.bcrypt.js/issues/155#issuecomment-15330726 .

goldenrum commented 11 years ago

Cool, thanks. Time to code away.