How to fix the bcrypt error in windows 7?

I updated my meteor project to 1.4.1.1 , it says that you are using pure JS implementation of bcrypt.

then i use meteor npm install --save bcrypt it gives me a lot of errors and i don`t know how to fix it …

1 Like

Here is my fix, hope it helps you:
Run these commands one by one:

  • npm install -g node-gyp
  • npm install --global --production windows-build-tools (this will take you about 15 minutes, just wait until it finish)
  • npm install -g node-pre-gyp
  • npm install -g chokidar
  • Run npm install --save bcrypt in the root directory of your app.
    There will be some warnings but it will work.
2 Likes

It didn’t solve the problem, Same errors i m getting again.
It is because of accounts-password package which uses bcrypt . Is there any alternative to this package ?. It might solve the problem.
or I think I should switch to Linux environment . What u think about that ?

1 Like

Can you check the version of accounts-password in the versions file? At best it should be 1.3.0 see also this (older) post: https://github.com/meteor/meteor/issues/7543#issuecomment-238303804

Also check where you get accounts-password included in your app to see if you can update that version.

yes, it is :-
accounts-base@1.2.11
accounts-password@1.3.0

I got this working by using a variation of the commands suggested by @lednhatkhanh:

meteor npm install -g node-gyp
meteor npm install --global --production windows-build-tools
meteor npm install -g node-pre-gyp
meteor npm install -g chokidar
meteor npm install --save bcrypt

now i m getting new errors


but i already set the python env variable . Is anything i m missing ?

You must add Python dir into your System PATH too, and make sure you are using Python 2, not 3.

1 Like

i m using python 2 7
i already set system variable " PATH = C:\python\python27 " and
" PYTHONPATH = C:\python\Python27\Lib;C:\python\Python27\DLLs;C:\python\Python27\Lib\lib-tk;C:\python\python27\Lib\site-packages; "

what else i need to do now. ?

ehm, how do I know where python is installed? :slight_smile:

import sys
sys.executable

If you’re upgrading to the latest version of Python for Windows 2.7.12, there is an option to add it automatically to the path.

windows-build-tools has been installing for about 8 hours:

Starting installation…
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Waiting for installers… -Successfully installed Python 2.7
Waiting for installers… -

Same problem for me, I tried more and more time

This worked for me:

Disable anti-virus software (Avast was giving false positives)
Install latest version of Python for Windows 2.7.12 (from https://www.python.org/downloads/)
Upgrade NodeJS to latest version 4.5 (from https://nodejs.org/en/download/)

Launch PowerShell as administrator

npm install -g node-gyp
npm install --global --production windows-build-tools
npm install -g node-pre-gyp
npm install -g chokidar

From root of your app folder:

meteor npm install --save bcrypt

I did receive the following warning:

…\src\bcrypt.cc(232): warning C4267: ‘=’: conversion from ‘size_t’ to ‘unsigned char’, possible loss of data

but it looks like it’s working now.

4 Likes

but " npm install --global --production windows-build-tools " already install the python 2.7 in my system …do i need to install it again from external source ??

You can probably skip the Python step. Those are just the steps I used.

I tired but get error

npm ERR! node v4.5.0                                                          
npm ERR! npm  v3.10.6                                                         
npm ERR! code ELIFECYCLE                                                      
                                                                              
npm ERR! bcrypt@0.8.7 install: `node-gyp rebuild`                             
npm ERR! Exit status 1                                                        
npm ERR!                                                                      
npm ERR! Failed at the bcrypt@0.8.7 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!     D:\meteor-app\pos\npm-debug.log                                  

Please help me.

Did you run all the commands one by one?

Thanks for your reply, waiting for a long time with

npm install --global --production windows-build-tools
1 Like

That’s what node-gyp requires, without that one installed, node-gyp doesn’t work.