Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcrypt struggles to install on W7 64bit #102

Closed
JohnMcLear opened this issue Sep 3, 2012 · 13 comments
Closed

bcrypt struggles to install on W7 64bit #102

JohnMcLear opened this issue Sep 3, 2012 · 13 comments
Labels

Comments

@JohnMcLear
Copy link

python and openssl installed
ssl installed in C:\OpenSSL-Win64
openssl.exe in C:\OpenSSL-Win64\bin

C:\temp\primarywall>npm install bcrypt --verbose > verbose.txt
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   'bcrypt',
npm verb cli   '--verbose' ]
npm info using npm@1.1.59
npm info using node@v0.8.8
npm verb node symlink C:\Program Files\nodejs\\node.exe
npm verb read json C:\temp\primarywall\package.json
npm verb read json C:\temp\primarywall\node_modules\async\package.json
npm verb read json C:\temp\primarywall\node_modules\cookies\package.json
npm verb read json C:\temp\primarywall\node_modules\mailer\package.json
npm verb read json C:\temp\primarywall\node_modules\mysql\package.json
npm verb read json C:\temp\primarywall\node_modules\python\package.json
npm verb read json C:\temp\primarywall\node_modules\socket.io\package.json
npm verb read json C:\temp\primarywall\package.json
npm verb cache add [ 'bcrypt', null ]
npm verb parsed url { pathname: 'bcrypt', path: 'bcrypt', href: 'bcrypt' }
npm verb lock bcrypt C:\Users\john\AppData\Roaming\npm-cache\51684124-bcrypt.lock
npm verb addNamed [ 'bcrypt', '' ]
npm verb addNamed [ null, '' ]
npm verb lock bcrypt@ C:\Users\john\AppData\Roaming\npm-cache\1351601c-bcrypt.lock
npm verb url raw bcrypt
npm verb url resolving [ 'https://registry.npmjs.org/', './bcrypt' ]
npm verb url resolved https://registry.npmjs.org/bcrypt
npm info retry registry request attempt 1 at 00:23:42
npm verb etag "6G0WFTH3297F8IDGS1LMXG8BB"
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm verb etag bcrypt from cache
npm verb addNamed [ 'bcrypt', '0.7.2' ]
npm verb addNamed [ '0.7.2', '0.7.2' ]
npm verb lock bcrypt@0.7.2 C:\Users\john\AppData\Roaming\npm-cache\b9391e73-bcrypt-0-7-2.lock
npm verb read json C:\Users\john\AppData\Roaming\npm-cache\bcrypt\0.7.2\package\package.json
npm info install bcrypt@0.7.2 into C:\temp\primarywall
npm info installOne bcrypt@0.7.2
npm verb from cache C:\Users\john\AppData\Roaming\npm-cache\bcrypt\0.7.2\package\package.json
npm info C:\temp\primarywall\node_modules\bcrypt unbuild
npm verb read json C:\temp\primarywall\node_modules\bcrypt\package.json
npm verb tar unpack C:\Users\john\AppData\Roaming\npm-cache\bcrypt\0.7.2\package.tgz
npm verb lock C:\temp\primarywall\node_modules\bcrypt C:\Users\john\AppData\Roaming\npm-cache\b8b8f635--primarywall-node-modules-bcrypt.lock
npm verb read json C:\temp\primarywall\node_modules\bcrypt\package.json
npm info preinstall bcrypt@0.7.2
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\package.json
npm verb readDependencies using package.json deps
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\package.json
npm verb readDependencies using package.json deps
npm verb cache add [ 'bindings@1.0.0', null ]
npm verb parsed url { pathname: 'bindings@1.0.0',
npm verb parsed url   path: 'bindings@1.0.0',
npm verb parsed url   href: 'bindings@1.0.0' }
npm verb parsed url { pathname: '1.0.0', path: '1.0.0', href: '1.0.0' }
npm verb addNamed [ 'bindings', '1.0.0' ]
npm verb addNamed [ '1.0.0', '1.0.0' ]
npm verb lock bindings@1.0.0 C:\Users\john\AppData\Roaming\npm-cache\f01e5454-bindings-1-0-0.lock
npm verb url raw bindings/1.0.0
npm verb url resolving [ 'https://registry.npmjs.org/', './bindings/1.0.0' ]
npm verb url resolved https://registry.npmjs.org/bindings/1.0.0
npm info retry registry request attempt 1 at 00:23:44
npm verb etag "1VQ5Q5SYHAX5F95YS1R6ARS24"
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0
npm verb etag bindings/1.0.0 from cache
npm verb read json C:\Users\john\AppData\Roaming\npm-cache\bindings\1.0.0\package\package.json
npm info install bindings@1.0.0 into C:\temp\primarywall\node_modules\bcrypt
npm info installOne bindings@1.0.0
npm verb from cache C:\Users\john\AppData\Roaming\npm-cache\bindings\1.0.0\package\package.json
npm info C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings unbuild
npm verb read json C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings\package.json
npm verb tar unpack C:\Users\john\AppData\Roaming\npm-cache\bindings\1.0.0\package.tgz
npm verb lock C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings C:\Users\john\AppData\Roaming\npm-cache\63398a58-les-bcrypt-node-modules-bindings.lock
npm verb read json C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings\package.json
npm info preinstall bindings@1.0.0
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings\package.json
npm verb readDependencies using package.json deps
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings\package.json
npm verb readDependencies using package.json deps
npm verb about to build C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings
npm info build C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\node_modules\bindings\package.json
npm verb linkStuff [ false,
npm verb linkStuff   false,
npm verb linkStuff   false,
npm verb linkStuff   'C:\\temp\\primarywall\\node_modules\\bcrypt\\node_modules' ]
npm info linkStuff bindings@1.0.0
npm verb linkBins bindings@1.0.0
npm verb linkMans bindings@1.0.0
npm verb rebuildBundles bindings@1.0.0
npm info install bindings@1.0.0
npm info postinstall bindings@1.0.0
npm verb about to build C:\temp\primarywall\node_modules\bcrypt
npm info build C:\temp\primarywall\node_modules\bcrypt
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\package.json
npm verb linkStuff [ false, false, false, 'C:\\temp\\primarywall\\node_modules' ]
npm info linkStuff bcrypt@0.7.2
npm verb linkBins bcrypt@0.7.2
npm verb linkMans bcrypt@0.7.2
npm verb rebuildBundles bcrypt@0.7.2
npm verb rebuildBundles [ 'bindings' ]
npm info install bcrypt@0.7.2
npm verb unsafe-perm in lifecycle true
gyp info it worked if it ends with ok
gyp verb cli [ 'node',
gyp verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@0.6.7
gyp info using node@0.8.8 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded for `%s` python C:\python27\python.EXE
gyp verb check python version `python --version` returned: "Python 2.7.3\r\n"
gyp verb check python version using version "2.7.3" to check
gyp verb get node dir no --target version specified, falling back to host node version: v0.8.8
gyp verb command install [ 'v0.8.8' ]
gyp verb install input version string "v0.8.8"
gyp verb installing legacy version? false
gyp verb install installing version: 0.8.8
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 0.8.8
gyp verb build dir attempting to create "build" dir: C:\temp\primarywall\node_modules\bcrypt\build
gyp verb build dir "build" dir needed to be created? C:\temp\primarywall\node_modules\bcrypt\build
gyp verb config.gypi creating config file
gyp verb config.gypi writing out config file: C:\temp\primarywall\node_modules\bcrypt\build\config.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\john\\.node-gyp\\0.8.8\\tools\\gyp\\gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2010',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\temp\\primarywall\\node_modules\\bcrypt\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\john\\.node-gyp\\0.8.8\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\john\\.node-gyp\\0.8.8',
gyp info spawn args   '-Dmodule_root_dir=C:\\temp\\primarywall\\node_modules\\bcrypt',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\temp\\primarywall\\node_modules\\bcrypt\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\john\.node-gyp\0.8.8
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe". guessing location
gyp verb "Release" dir needed to be created? null
gyp verb copying "node.lib" for x64 C:\Users\john\.node-gyp\0.8.8\Release\node.lib
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/property:TargetExt=.node',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
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:219: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.7600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\primarywall\node_modules\bcrypt
gyp ERR! node -v v0.8.8
gyp ERR! node-gyp -v v0.6.7
gyp ERR! not ok
npm info bcrypt@0.7.2 Failed to exec install script
npm info C:\temp\primarywall\node_modules\bcrypt unbuild
npm verb from cache C:\temp\primarywall\node_modules\bcrypt\package.json
npm info preuninstall bcrypt@0.7.2
npm info uninstall bcrypt@0.7.2
npm verb true,C:\temp\primarywall\node_modules,C:\temp\primarywall\node_modules unbuild bcrypt@0.7.2
npm info postuninstall bcrypt@0.7.2
npm ERR! bcrypt@0.7.2 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.2 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.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--verbose"
npm ERR! cwd C:\temp\primarywall
npm ERR! node -v v0.8.8
npm ERR! npm -v 1.1.59
npm ERR! code ELIFECYCLE
npm verb exit [ 1, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\temp\primarywall\npm-debug.log
npm ERR! not ok code 0

C:\temp\primarywall>
@TooTallNate
Copy link
Collaborator

You need to have MSVC C++ Express installed and the Windows 64-bit SDK. See: https://github.com/TooTallNate/node-gyp#installation

@JohnMcLear
Copy link
Author

Just FYI This is something that really puts me off using the bcrypt package.

@ncb000gt
Copy link
Member

ncb000gt commented Sep 4, 2012

Well, gyp is the build tool we use which uses the microsoft build tools. What are your aversions to installing the requirements outside of it being a "cancer" on a system. Specifically what are your gripes with using msbuild to compile the module?

@JohnMcLear
Copy link
Author

My specific gripe is that out of 3 of 4 windows 7 machine I have I can't install the SDK because it fails to install. Same applies to windows updates and a variety of other MS packages.

I'd literally have to format my machine and install from blank to install bcrypt.. I guess the "cancer" thing was a little strong, perhaps "anthrax" is more apt ;)

I'm not having a go at MS or VSS or the MS SDK, it's just anything that depends on them to compile imho is risking excluding itself from quite a large audience of people who just can't justify a 1.6GB download to install a 5MB node app.

For now I'm doing my dev on a linux box to save the headache but when customers come to deploy I can't ask them to install the Microsoft SDK so I'm left with two options which is..

  1. Don't use bcrypt (Sucks cause I have it working great on nix).

  2. Try to persuade them to install the SDK which would really kill me inside and no doubt make for masses of extra costs/headache in deployment.

You guys are doing a great job and I don't want to sound like I'm nagging but I do feel if you can find a way to make it compile on windows without the MS SDK you will make your module better..

@andrescabana86
Copy link

same problem to me on 64-bit window

@shaneMangudi
Copy link

Been trying to get node.bcrypt.js working on my Windows8 64bit for the past week. Downloading about 2GB worth of stuff with my slow internet wasn't fun. The fact that the Windows SDK simply failed to start downloading (without throwing any errors) didn't help either. Finally I got it all installed. But nodegyp -rebuild still failed.

I gave up and created a native implementation of bcrypt for nodejs. You can find it at https://github.com/shaneGirish/bcrypt-nodejs

Its API resembles the API of node.bcrypt.js and I've done some minor testing which doesn't seem to show any problems as of yet. Also, I'm not sure how it compares to node.bcrypt.js in speed but its worth a look, I guess.

@JohnMcLear
Copy link
Author

You sir, are a very kind old chap. Good work!

@defunctzombie
Copy link
Collaborator

One quick comment I would make is that your async versions are not actually async in the way that you think. While you do use setTimeout (process.nextTick would be better), they don't actually run in separate threads and thus will block the node process when they do execute.

@shaneMangudi
Copy link

So, do I have to use something like https://github.com/cramforce/node-worker or is there an easier or better way ? Please advice.

@defunctzombie
Copy link
Collaborator

Not sure I would go the webworker route personally (but it could work depending on how it is implemented). Realistically you would need to spin up a pool of nodejs processes and hand off the work to them. I believe this can be done with childprocess.fork which will give you the built in IPC channel to pass off the work and wait for response. The worker would be the one who then runs the sync code and returns the results. I am sure there is a module that does this just don't know of any off the top of my head. Would not be that hard to make it if it doesn't already exist. IIRC one of the mozilla browserid folks did something similar. /ping @lloyd

@shaneMangudi
Copy link

I just ran into https://github.com/robtweed/Q-Oper8 and https://github.com/kriszyp/multi-node

Creating more process has a memory overhead. I remember reading that each node process uses up atleast 10Mb.
WebWorkers on the other hand, I think wouldn't use as much (am I wrong ?)

@shaneMangudi
Copy link

If I understood this correctly, it is simply a matter of picking the best suited solution. Multiple processes would be best suited for an environment which has a lot of memory to spare. WebWorkers, when the environment forces you to be stingy.

@lloyd
Copy link
Contributor

lloyd commented Sep 17, 2012

Yo @shtylman !

@shaneGirish - I'd suggest don't bother with async versions. Use one of the things mentioned above or lloyd/node-computecluster

At mozilla in the persona project we're using this library on large scale deployments, and we intentionally do not use the async calls of this library (which use nodes internal threadpool) and instead use multiple processes. Here's a talk I did about our approach: http://www.youtube.com/watch?v=U0hNgO5hrtc

hth!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants