node.bcrypt.js: npm install bcrypt fails on Windows 7 with node.js 64bit
I have bcrypt 0.7.1 building on two computers running windows 7 now.
The following setup WORKS: Windows 7 ultimate 64bit service pack 1 Python 2.7.3 64bit (python-2.7.3.amd64.msi) VC 2008 redistributables 32 bit (vcredist_x86.exe) Visual studio 2010 c# and c++ environments installed Win32OpenSSL-1_0_1c.exe Node.js 0.8.5 or 0.8.6 32bit
The following setup does NOT WORK: Windows 7 ultimate 64bit service pack 1 Python 2.7.3 64bit (python-2.7.3.amd64.msi) VC 2008 redistributables 32 bit (vcredist_x86.exe) Visual studio 2010 c# and c++ environments installed Win32OpenSSL-1_0_1c.exe Node.js 0.8.5, 0.8.6 64bit
When building with 64 bit node.js version 0.8.6 I get the following linker errors
Daniel@DANIEL-LAPTOP ~/Dropbox/wwwroot (master) $ npm install bcrypt npm WARN package.json development@0.0.3 No README.md file found! npm WARN package.json jade@0.26.3 No README.md file found! npm WARN package.json mongodb@1.0.2 No README.md file found! npm WARN package.json passport@0.1.9 No README.md file found! npm WARN package.json passport-local@0.1.3 No README.md file found! npm WARN package.json stylus@0.27.1 No README.md file found! 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.1 install C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt node-gyp rebuild
C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt>node “c:Program Files\nodejs\node_modules\npm
\bin\node-gyp-bin.…\node_modules\node-gyp\bin\node-gyp.js” rebuild
gyp http GET http://nodejs.org/dist/v0.8.6/node-v0.8.6.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.6/node-v0.8.6.tar.gz
gyp http GET http://nodejs.org/dist/v0.8.6/node.lib
gyp http GET http://nodejs.org/dist/v0.8.6/x64/node.lib
gyp http 200 http://nodejs.org/dist/v0.8.6/node.lib
gyp http 200 http://nodejs.org/dist/v0.8.6/x64/node.lib
blowfish.cc
bcrypt.cc
…\src\bcrypt.cc(232): warning C4267: ‘=’ : conversion from ‘size_t’ to ‘unsigned char’, possible loss of data [C:\User
s\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
bcrypt_node.cc
c:\users\daniel.node-gyp\0.8.6\src\node_object_wrap.h(57): warning C4251: ‘node::ObjectWrap::handle_’ : class ‘v8::Per
sistent<T>’ needs to have dll-interface to be used by clients of class ‘node::ObjectWrap’ [C:\Users\Daniel\development\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
with
[
T=v8::Object
]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Daniel\Dropbox\wwwroot\node_module
s\bcrypt\build\bcrypt_lib.vcxproj]
…\src\bcrypt_node.cc(211): warning C4244: ‘argument’ : conversion from ‘ssize_t’ to ‘unsigned char’, possible loss of
data [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
…\src\bcrypt_node.cc(278): warning C4244: ‘argument’ : conversion from ‘const ssize_t’ to ‘unsigned char’, possible lo
ss of data [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
…\src\bcrypt_node.cc(361): warning C4267: ‘initializing’ : conversion from ‘size_t’ to ‘int’, possible loss of data [C
:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
…\src\bcrypt_node.cc(362): warning C4267: ‘initializing’ : conversion from ‘size_t’ to ‘int’, possible loss of data [C
:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) d
oes not match the Linker’s OutputFile property value (.node). This may cause your project to build incorrectly. To corr
ect this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in
%(Link.OutputFile). [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj
]
Creating library C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\Release\bcrypt_li
b.lib and object C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\Release\bcrypt_lib.e
xp
bcrypt_node.obj : error LNK2001: unresolved external symbol RAND_bytes [C:\Users\Daniel\Dropbox\w
wwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
bcrypt_node.obj : error LNK2001: unresolved external symbol CRYPTO_set_id_callback [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
bcrypt_node.obj : error LNK2001: unresolved external symbol CRYPTO_num_locks [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
bcrypt_node.obj : error LNK2001: unresolved external symbol CRYPTO_set_locking_callback [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
bcrypt_node.obj : error LNK2001: unresolved external symbol RAND_pseudo_bytes [C:\Users\Daniel\Dropbox\Fivel dev\develo
pment\wwwroot\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\Release\bcrypt_lib.node : fatal error L
NK1120: 5 unresolved externals [C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt\build\bcrypt_
lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:2
15:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command “node” “c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuil
d”
gyp ERR! cwd C:\Users\Daniel\Dropbox\wwwroot\node_modules\bcrypt
gyp ERR! node -v v0.8.6
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok
npm ERR! bcrypt@0.7.1 install: node-gyp rebuild
npm ERR! cmd "/c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.1 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\nodejs\node.exe” “c:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” " install" “bcrypt” npm ERR! cwd C:\Users\Daniel\Dropbox\wwwroot npm ERR! node -v v0.8.6 npm ERR! npm -v 1.1.48 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\Daniel\Dropbox\wwwroot\npm-debug.log npm ERR! not ok code 0
Daniel@DANIEL-LAPTOP ~/Dropbox/wwwroot (master) $
You can install 2 versions of node.js both the 32 bit and 64bit and change the path that points to which version of node.js you want to test both architectures. I had both 64 and 32 bit node.js installed and when i changed my path to point to: c:\Program Files (x86)\nodejs instead of c:\Program Files\nodejs
It built no problem.
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 23 (5 by maintainers)
Maybe one day someone really really bored and/or annoyed, because brypt again doesn’t build on windows/something else, will fork and create a pure node blowfish implementation, maybe porting http://code.google.com/p/javascript-bcrypt/ which should be pretty easy as it supports the whole lot, but somewhat slower, thinking acceptably though, hint hint at someone with more time (@ncb000gt ???)