The following is the error trace. Worked fine with Node 5.10.1 Stable
The mentioned log file did not exist, so attaching the whole console print
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Users\rahulg\AppData\Roaming\npmnode_modules\npm\bin\node-gyp-bin....node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
blowfish.cc
bcrypt.cc
bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=': conversion from 'size_t' to 'unsigned char', possible loss of data [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(592): error C2039: 'GCEpilogueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\rahulg.node-gyp\6.0.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc)
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(592): error C2065: 'GCEpilogueCallback': undeclared identifier (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bc
rypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(593): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(593): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\bu
ild\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(593): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node_
modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(598): error C2039: 'GCEpilogueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\rahulg.node-gyp\6.0.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc)
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(598): error C2065: 'GCEpilogueCallback': undeclared identifier (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bc
rypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(598): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(598): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\bu
ild\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(598): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node_
modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(603): error C2039: 'GCPrologueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\rahulg.node-gyp\6.0.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc)
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(603): error C2065: 'GCPrologueCallback': undeclared identifier (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bc
rypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(604): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(604): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\bu
ild\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(604): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node_
modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(609): error C2039: 'GCPrologueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\rahulg.node-gyp\6.0.0\include\node\v8.h(5306): note: see declaration of 'v8::Isolate' (compiling source file ..\src\bcrypt_node.cc)
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(609): error C2065: 'GCPrologueCallback': undeclared identifier (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bc
rypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(609): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node
_modules\bcrypt\build\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(609): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\bu
ild\bcrypt_lib.vcxproj]
c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcryptnode_modules\nan\nan.h(609): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\bcrypt_node.cc) [c:\Users\rahulg\Desktop\nodeJsApi\node_
modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(76): warning C4244: 'argument': conversion from 'ssize_t' to 'unsigned char', possible loss of data [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(135): warning C4244: 'argument': conversion from 'const ssize_t' to 'unsigned char', possible loss of data [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(229): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(230): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\rahulg\AppData\Roaming\npmnode_modules\npmnode_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\rahulg\AppData\Roaming\npmnode_modules\npmnode_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\rahulg\Desktop\nodeJsApinode_modules\bcrypt
gyp ERR! node -v v6.0.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\rahulg\AppData\Roaming\npmnode_modules\npm\bin\npm-cli.js" "rebuild"
npm ERR! node v6.0.0
npm ERR! npm v3.8.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! c:\Users\rahulg\Desktop\nodeJsApi\npm-debug.log
I encountered similar C++ compilation errors on Node v6 under Ubuntu.
Try removing /node_modules/bcrypt, it will force the module to be reinstalled from scratch and should work.
Didn't work for me on Ubuntu 16.04 x64 with nvm installed Node v6.
Perhaps I'm missing an apt dependency?
On Tuesday, May 3, 2016, Pier-Luc Gendreau [email protected] wrote:
Try removing /node_modules/bcrypt, it will force the module to be
reinstalled from scratch and should work.—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/ncb000gt/node.bcrypt.js/issues/416#issuecomment-216515359
Same issue on Win 7 64bit with this error:
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 Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [D:\Dev\Work\Repositories\api-server\node_modules\bcry
pt\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
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:204:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Dev\Work\Repositories\api-server\node_modules\bcrypt
gyp ERR! node -v v6.0.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "i" "bcrypt"
npm ERR! node v6.0.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:\Dev\Work\Repositories\api-server\npm-debug.log
All 3 suggestions from the list are fulfilled..
Microsoft .NET v - 4.6.1
Visual Studio 2013 build 12.0.30501.0
Same issue on Ubuntu.
I tried to recreate this with a Docker image, but wasn't able to. Some
additional specifics from when I encountered this:
However I just tried again from nvm Node v6.0 and everything is fine now...
On Wed, May 4, 2016 at 9:29 AM, Phaninder Pasupula <[email protected]
wrote:
Same issue on Ubuntu.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/ncb000gt/node.bcrypt.js/issues/416#issuecomment-216865160
I had an older project targeting bcrypt 0.8.5 instead of 0.8.6, which might
have also been the problem.
On Thu, May 5, 2016 at 10:00 PM, James O'Cull [email protected] wrote:
I tried to recreate this with a Docker image, but wasn't able to. Some
additional specifics from when I encountered this:
- Ubuntu 16.04
- Node v6.0.0 installed from nvm (I noticed they have v6.1 now, so maybe
this is better)However I just tried again from nvm Node v6.0 and everything is fine now...
On Wed, May 4, 2016 at 9:29 AM, Phaninder Pasupula <
[email protected]> wrote:Same issue on Ubuntu.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/ncb000gt/node.bcrypt.js/issues/416#issuecomment-216865160
I am having the same issue with:
I tried with vcbuildForNode but it did not work.
I also tried to install the gcc compiler from Cygwin but I could not manage npm to call gcc instead of VCBuild.exe (as the third option in the error message said).
To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.
I suppose my last option is to install .NET Framework or VS or both...
I have just installed VS Community Edition and VCBuild.exe is not there.
I only have the ".NET framework" option left, so if it doesn't work I will have to through my Windows away...
For Windows users, installing Microsoft Build Tools 2015 should do the trick. Then install bcrypt using this command:
npm install bcrypt --msvs_version=2015
Also, make sure you have Python 2.7.x.
Thanks @Zertz, I will give it a try and come back here with some feedback.
In the meantime, what about getting npm to use the gcc compiler from Cygwin?
Looks like it is not supported.
Well, you can't install npm from Cygwin but you can install node (and npm) from https://nodejs.org/en/download/ and use both from Cygwin.
By the way after installing Microsoft Build Tools 2015 and npm install bcrypt --msvs_version=2015 I got the following error:
error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
Oops, I thought build tools were enough!
What I usually do for my PC's is install Visual Studio Express for Desktop. Choose _Custom install_ (or something along those lines) and make sure Windows SDK is checked, it's nested under something else (sorry, that's not too clear, but I don't remember exactly!).
There has to be an easier way, but I happen to need Visual Studio anyway.
P.S. That error does indicate that you're heading in the right direction :-)
I installed VS express and now it works.
Although I am not sure what sorted it out.
I did this:
npm install in my app foldernpm install bcrypt --msvs_version=2015 in my app folderI tested it again from scratch and without removing bcrypt as a dependency in package.json it did not work (with VS Express) and also "VCBuild.exe" is not in my Windows.
So now I am not sure what sorted out (VS community edition, the Microsoft Building Tools or VS Express)...
Any Visual Studio edition with Windows SDK should work.
@Zertz Thanks mate, Finally I compiled node bcrypt on Windows 7. And this is my first node-gyp based module build on Windows. :-)
Most helpful comment
@Zertz Thanks mate, Finally I compiled node bcrypt on Windows 7. And this is my first node-gyp based module build on Windows. :-)