bcrypt NodeJS module setup in Windows

bcrypt lib helps with creation of hash passwords and widely used in various NodeJS applications. While it is quite easy to setup in Linux environment, it is quite complex in Windows environment due to ambigous error messages shown during installation.

As part of my training at Vuja De Labs one of the task was to setup Pellustro on Windows. The primary issue faced was bcrypt module setup. This blog outlines the steps required to configure it in Windows environment.

bcrypt module setup will require presence of some binaries already installed in system.

  • NodeJS – It should be already installed.
  • Install node-gyp, node-gyp has dependencies on the following binaries. Make sure to install them before node-gyp
    • Install Python 2.7.3
      (version 2.7.3 is recommended, node-gyp does not support v3.x.x).
    • Install Microsoft Visual Studio C++ 2012 for Windows Desktop (Express Version works well too).

    Now you can install node-gyp with npm :

    npm install -g node-gyp

  • Install Win64OpenSSL-100e.exe for 64-Bit and Win32OpenSSL-100e.exe for 32-Bit
  • Install brcypt module

    npm install bcrypt –openssl-root=”C:somepathtoopenssl”

In case of queries regarding installation please leave a comment below.

Leave a comment