bcrypt - windows 10 x64 build error - node.js

I have issue with bcrypt installation on windows 10 x64.
My installs:
node = 6.31
node-gyp = 3.4.0
npm = 3.10.3
python = 2.7.0
VSCommunity 2015
windows build tools
I have readed how to, with bcrypt package, based on node-gyp. I am really tired of fighting with this issue. I got error: (PS I tried with v0.8.6)
> bcrypt#0.8.6 install C:\Users\pi15463\www\BaaS\node_modules\bcrypt
> node-gyp rebuild
C:\Users\pi15463\www\BaaS\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo dules\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\pi15463\www\BaaS\node_modules\bcrypt\bui ld\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(76): warning C4244: 'argument': conversion from 'ssize_t' to 'unsigned char', possible loss of data [C:\Users\pi15463\www\BaaS\node_module s\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\pi15463\www\BaaS\node_modules\bcry pt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(230): warning C4267: 'initializing': conversion from 'size _t' to 'int', possible loss of data [C:\Users\pi15463\www\BaaS\node_modules\bcry pt\build\bcrypt_lib.vcxproj]
win_delay_load_hook.c
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_loa d_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type m odifiers [C:\Users\pi15463\www\BaaS\node_modules\bcrypt\build\bcrypt_lib.vcxproj ]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134) : note: see declaration of '__pfnDliNotifyHook2'
Like you see a bounch of warns and no files at all. I saw some similar problems, but every1 has different configuration, so I decided to create a new thread.
Why on Ubuntu everything works ok, and on windows always are problems...
Hate my corporate pc.
Please for hints, and best regards!
Uland

I had the same problem: windows10 pc and no way to get bcrypt installed.
I solved this by using bcryptjs (do not confuse it with bcrypt).
Basically bcryptjs does the same job as bcrypt but the former is written in pure js and has no cumbersome dependencies. The only downside is that it is 30% slower than bcrypt.
For me it worked right away.
here is the link to the relevant page on the npmjs website:

Related

Visual C++ 2017 link error due to -Ot flag?

I am trying to get a Visual Studio 2017 project to link, but I'm stuck on the following linker error:
LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
I've read questions on what the cause could be, but I couldn't come to a solution for my project.
The details are that, due to an external component we have no control over (component A), this Visual Studio 2017 project is forced to use the v14.13 version of the C++ toolchain, i.e. not the latest one (v14.14). However, the latest release of another external precompiled static lib we have no control over either (component B), is built with the v14.14 version (I checked via a dumpbin extract of the debug version of the lib). Switching my project over to the v14.14 toolchain indeed makes the link error go away on component B, but this unfortunately isn't a solution for me due to component A. Taking an earlier version of component B isn't desirable either, since we need the functionality in the latest release...
However, what strikes me, is that the /Ot ("optimize for speed") flag has been around since the middle ages... Why wouldn't v14.13 recognize it? Or is it just an (awkwardly manifested) matter of a mismatched obj file layout due to the version differences? And, probably related, what does the 'p2' stand for anyway?
Update
I've checked the linker output by using the /verbose flag, and all seems normal (3600 lines of Searching <lib>, Found <function>, Referenced in <obj> and Loaded <lib>).
Right up until the end that is, where I get the following 6 lines:
1> Searching C:\PathToExternalLib\TheirStatic.lib:
1> Found UsedFunctionName
1> Referenced in MyOwnStatic.lib(MyOwnCompileUnit.obj)
1>LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
1>LINK : fatal error LNK1257: code generation failed
1>Done building project "MyProject.vcxproj" -- FAILED.
And that's that.
When visiting the command line setting of the link properties of the project, the only thing listed is (broken up in separate lines for convenience):
/OUT:"MyProject.dll"
/MANIFEST
/NXCOMPAT
/PDB:"MyProject.pdb"
/DYNAMICBASE "C:\PathToMyStatic.lib"
/IMPLIB:"MyProject.lib"
/DLL
/MACHINE:X64
/PGD:"MyProject.pgd"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"MyProject.prm.intermediate.manifest"
/ERRORREPORT:PROMPT
/NOLOGO
/LIBPATH:"C:\PathToExternalStaticLib"
/LIBPATH:"C:\PathToAnotherExternalStaticLib"
/TLBID:1
So no trace of any -Ot flag there as well...?
I had this problem. LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
while building a project with Visual Studio 2015.
I had to rebuild any library or sub library the project linked to which were built with Visual Studio 2017.
Once I rebuild the dependent libraries with Visual Studio 2015 the first project was able to link against them.
project
--------\
---------lib1(unable to rebuild lib1 until its dependencies were also rebuilt with VS2015
--------------\lib_linked_by_lib1_which_was_build_with_VS2017_and_had_to_be_rebuilt
--------------\another_lib_which_had_to_be_rebuilt_for_lib1_with_VS2015
--------\lib2
--------\lib3

npm install bcrypt - no errors but a whole raft of warnings on windows 7

OK, so all the brcypt issues on here seem to be node-gyp related, but after playing with bcrypt for a while I finally got it installing with no errors and node-gyp seems happy, but I am still getting quite a few warnings. It's obviously related to visual studio but I can't find anything about these specifically.
I'm on windows 7 x64 ultimate and have:
visual studio 2012 utlimate
visual studio 2013 ultimate
python 0.2.7.10
windows 7 x64 sdk with all updates
Win64OpenSSL-1_0_lt
I'm getting the following warnings:
D:\WebstormProjects\authapp>npm install --save bcrypt
npm WARN package.json authapp#1.0.0 No description
npm WARN package.json authapp#1.0.0 No README data
bcrypt#0.8.6 install D:\WebstormProjects\authapp\node_modules\bcrypt
node-gyp rebuild
D:\WebstormProjects\authapp\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\n
odejs\node_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 d
ata [D:\WebstormProjects\authapp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(76): warning C4244: 'argument' : conversion from 'ssize_t' to 'unsigned char', possib
le loss of data [D:\WebstormProjects\authapp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(229): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible los
s of data [D:\WebstormProjects\authapp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(230): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible los
s of data [D:\WebstormProjects\authapp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]**
win_delay_load_hook.c
Creating library D:\WebstormProjects\authapp\node_modules\bcrypt\build\Release\bcrypt_lib.lib and obje
ct D:\WebstormProjects\authapp\node_modules\bcrypt\build\Release\bcrypt_lib.exp
Generating code
Finished generating code
bcrypt_lib.vcxproj -> D:\WebstormProjects\authapp\node_modules\bcrypt\build\Release\\bcrypt_lib.node
bcrypt#0.8.6 node_modules\bcrypt
├── bindings#1.2.1
└── nan#2.2.1
Does anyone have any ideas what's gone wrong here?
Thanks.
If you're on Windows, I recommend you use Bcrypt-NodeJS to avoid these errors if possible. You'll get about the same functionality, as far as I can tell.

Building node contextify using Visual Studio 2013

I'm attempting to get "contextify" to build on my machine. It is a Windows 10 machine.
I am using Windows 10
I have Visual Studio 2013 Professional installed.
I have python 2.7.10, and it's in my PATH.
I have node 4.1.2 32 bit installed (I had previously tried with 64 bit, which is the default that the node website wanted me to download, but it appears to make no difference).
I've got no idea what the right sequence of steps should be, I don't know anything about node-gyp, npm etc, I'm just trying to build a project that has a dependency on contextify.
I've done a clone of the contextify repo from git hub and naively run
`npm install'. I'm using a Visual Studio command prompt (either VS2013 x64 Native Tools Command Prompt or VS2013 x86 Native Tools Command Prompt, makes no difference).
What I get is this:
d:\work\contextify>npm install
> contextify#0.1.14 install d:\work\contextify
> node-gyp rebuild
d:\work\contextify>if not defined npm_config_node_gyp (node "C:\Users\tomq\AppData\Roaming\npm\node_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.
contextify.cc
d:\work\contextify\node_modules\nan\nan.h(263): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)' : function te
mplate has already been defined [d:\work\contextify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(256) : see declaration of '_NanEnsureLocal'
d:\work\contextify\node_modules\nan\nan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type
[d:\work\contextify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(661): error C2039: 'FreeCallback' : is not a member of 'node' [d:\work\contex
tify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(661): error C2061: syntax error : identifier 'FreeCallback' [d:\work\contexti
fy\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(665): error C2065: 'callback' : undeclared identifier [d:\work\contextify\bui
ld\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(665): error C2065: 'hint' : undeclared identifier [d:\work\contextify\build\c
ontextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(672): error C2665: 'node::Buffer::New' : none of the 4 overloads could conver
t all the argument types [d:\work\contextify\build\contextify.vcxproj]
C:\Users\tomq\.node-gyp\4.1.2\include\node\node_buffer.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buff
er::New(v8::Isolate *,char *,size_t)'
C:\Users\tomq\.node-gyp\4.1.2\include\node\node_buffer.h(31): or 'v8::MaybeLocal<v8::Object> node::Buff
er::New(v8::Isolate *,v8::Local<v8::String>,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
d:\work\contextify\node_modules\nan\nan.h(676): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v8::Object>
&)' : cannot convert argument 1 from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' [d:\work\contextif
y\build\contextify.vcxproj]
Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be cal
led
d:\work\contextify\node_modules\nan\nan.h(683): error C2039: 'Use' : is not a member of 'node::Buffer' [d:\work\context
ify\build\contextify.vcxproj]
d:\work\contextify\node_modules\nan\nan.h(683): error C3861: 'Use': identifier not found [d:\work\contextify\build\cont
extify.vcxproj]
I have read the Contextify Windows Install Guide, but it doesn't really help me. I have read many other posts as well.
Am I supposed to be able to get this to compile using Visual Studio 2013?
Thanks.
I've got same issue.
I've solved this problem.
Contextify is not supported in node 4.x.
So I've downgrade node to 0.10.x, then works fine.
Alyosha.

Node.js npm installing websocket fails

I am installing websocket through npm in Windows 7 64 bit. The websocket version is 1.0.8
I am getting a linking error even though I have Visual Studio 2010 and Python 2.7 :
C:\Windows\system32\node_modules\websocket>node "C:\Program Files (x86)\nodejs\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" r
ebuild
validation.cc
C:\Users\User\.node-gyp\0.10.30\deps\v8\include\v8.h(184): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\Windows\system32\node_modules\websocket\build\validation.vcxproj]
with
[
T=v8::Object
]
LINK : fatal error LNK1104: cannot open file 'C:\Windows\system32\node_modules\w
ebsocket\build\Release\validation.node' [C:\Windows\system32\node_modules\websoc
ket\build\validation.vcxproj]
xor.cpp
C:\Users\User\.node-gyp\0.10.30\deps\v8\include\v8.h(179): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\Windows\system32\node_modules\websocket\build\xor.vcxproj]
with
[
T=v8::Object
]
LINK : fatal error LNK1104: cannot open file 'C:\Windows\system32\node_modules\w
ebsocket\build\Release\xor.node' [C:\Windows\system32\node_modules\websocket\bui
ld\xor.vcxproj]
gyp[websocket v1.0.8]
Native code compile failed!!
Please note that this module DOES NOT REQUIRE the native components
and will still work without them, though not quite as efficiently.
On Windows, native extensions require Visual Studio and Python.
On Unix, native extensions require Python, make and a C++ compiler.
Start npm with --websocket:verbose to show compilation output (if any).
websocket#1.0.8 node_modules\websocket
C:\Windows\system32>
Is there a way to skip this compilation stuff and just use this module right away ? Or someway to fix this error ?
PS: the command prompt was started with Admin rights.

Install Shield LE - Error 6058 ... merging Visual C++ 10.0 CRT in 64bit

I'm trying to compile an install shield project. It's a 64 bit program.
I keep getting this error, although it does compile OK and installs OK:
Error 16 -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm ISEXP : error : -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm
Any idea how can tell it NOT to try and merge ? (I can let it install the CRT ad a redistributable instead)
Ok, so it's like this:
Was detected as a dependency by mistake:
Adding merge module 'Visual C++ 10.0
CRT (IA64)' that is a dependency of
component
'MyProjectName.Primary_output'
So you go to:
Specify application Data -> Files
Right click on the specified project that had the dependency.
Choose Dependencies from scan at build.. find that unwanted file, and uncheck it.
Some Installshield products (2010, 2011 at least) appear to have an issue scanning managed (/clr) c++ modules that use the 10.0 CRT, even for 32-bit-only projects. In those cases the IA64 msm gets added to the project, producing "error -5008: Intel64 or AMD64 must be specified in the template of the Summary Stream". Yochai's fix cured that too. I have not seen this issue for native c++ code.

Resources