npm module 'bcrypt' is not installing in windows 10 and throwing error in sails

I tried another way to fix this issue on Window 10. I hope it can help you.
1st step: run Powershell with Administrator role (Click right mouse on Powershell and choose "Run As Administrator")
2nd step: install native addon build tool and Windows-Build-Tools

 npm install -g node-gyp
 npm install --g --production windows-build-tools

3rd step: change directory to current project
4th step: install bcrypt

 npm install bcrypt

From the logs I see that you are using windows operating system.

Here on this github page of node-gyp, it says you need to have the following

  • On Windows:
    • Python ([v2.7.10][python-v2.7.10] recommended, v3.x.x is not supported)
      • Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder
    • Windows XP/Vista/7:
      • Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well)
      • If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first
      • If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]
    • Windows 7/8:
      • Microsoft Visual Studio C++ 2013 for Windows Desktop ([Express][msvc2013] version works well)
    • Windows 10:
      • Install the latest version of npm (3.3.6 at the time of writing)
      • Install Python 2.7 from https://www.python.org/download/releases/2.7/ and make sure its on the System Path
      • Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation)
      • Set the environment variable GYP_MSVS_VERSION=2015
      • Run the command prompt as Administrator
      • $ npm install (--msvs_version=2015) <-- Shouldn't be needed if you have set GYP_MSVS_VERSION env
      • If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough
    • All Windows Versions
      • For 64-bit builds of node and native modules you will also need the [Windows 7 64-bit SDK][win7sdk]
      • You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK:

For others operating system you can visit the link to see their dependencies.