I found many answers like a kind of this question, but all of them could not solve my problem. Here are my versions installed:
node 0.10.31
npm 1.4.23
node-gyp 0.10.31
bcrypt 0.7.8
I have the dependency in package.json "bcrypt": "0.7.x"
. Here are my step-by-step:
npm install
gyp ERR! stack Error: Can't find Python executable "python", you can
set the PYTHON env variable.
I had to install Python 2.7.*
npm install
MSBUILD : error MSB3428: Could not load the Visual C++ component
"VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK,
2) install Microsoft Visual Studio 2005 or 3) add the location of the
component to the system path if it is installed elsewhere.
I had to install Visual Studio 2008 (Professional) which is the only one I had in my hand. And I added the PATH variable C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages
where vcbuild.exe is.
npm install
againVCBUILD : error Message: [D:\...\node_modules\bcrypt\build\binding.sln]
VCBUILD : System error : -2147154687. [D:\...\node_modules\bcrypt\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe`
failed with exit code: 1
It seems using .NET 4 and failed. I have six .NET frameworks folders in C:\Windows\Microsoft.NET\Framework
and it seems using the latest one:
npm install --msvs_version=2008
Same error as (2).
npm install --msvs_version=2012
Error changed a little bit.
D:\...\node_modules\bcrypt\build\bcrypt_lib.vcxproj(18,3): error MSB4019: The imported
project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the
<Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe`
failed with exit code: 1
D:\...\node-proj>node-gyp rebuild --msvs_version=2008
'node-gyp' is not recognized as an internal or external command,
operable program or batch file.
Is there any idea on this?
I followed the Windows installation step for node-gyp and installing Microsoft Visual Studio C++ 2010 Express solved the problem except a few warnings. I did see the library created in the console message.
The build process seems looking for [Drive]:\Program Files\Microsoft Visual Studio 10.0\VC\vcpackages\vcbuild.dll
which is installed by Visual Studio C++ 2010 Express.
Firstly I installed Microsoft Visual Studio C++ 2012/13 for Windows Desktop, one of the requirement for Windows7/8. But it did not work actually and it is not necessary for Windows 7.
The node-gyp
requirement for Windows 7 32 bits (Windows 7/8 64 bits may have different requirement):
This is a requirement not only for bcrypt
, but all node modules which needs to be built using node-gyp. If you check the configuration files of a module, you will see its requirement, for example, you can check the following files:
\node_modules\bcrypt\build\binding.sln
\node_modules\bcrypt\build\config.gypi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With