Environment Information
Steps to Reproduce
I followed the steps as per this comment on issue 273 which are
git clone https://github.com/Blizzard/node-rdkafka.git node-rdkafka --recursive
cd node-rdkafka
npm install nan
node-gyp rebuild --verbose
Fails with error message: "MSBUILD : error MSB1009: Project file does not exist." originating from file "build\depslibrdkafka.vcxproj"
node-rdkafka Configuration Settings
I don't know what information you need here.
Additional context
Any suggestions for how to diagnose and resolve this are welcome!
I also tried installing the package via npm. Executing npm i node-rdkafka the output also includes these lines:
Warning: Missing input files:
C:\projects\hypr\licevent-publisher-service\node_modules\node-rdkafka\build\deps....\deps\depslibrdkafka\win32\outdir\v120x64\Release\zlib.dll
C:\projects\hypr\licevent-publisher-service\node_modules\node-rdkafka\build\deps....\deps\depslibrdkafka\win32librdkafka.sln
C:\projects\hypr\licevent-publisher-service\node_modules\node-rdkafka\build\deps....\deps\depslibrdkafka\win32\outdir\v120x64\Releaselibrdkafkacpp.dll
C:\projects\hypr\licevent-publisher-service\node_modules\node-rdkafka\build\deps....\deps\depslibrdkafka\win32\outdir\v120x64\Releaselibrdkafka.dll
Followed later by
Copying deps/librdkafka/win32/outdir/v120/x64/Release/librdkafkacpp.dll to ../build/Releaselibrdkafkacpp.dll
The system cannot find the file specified.
Copying deps/librdkafka/win32/outdir/v120/x64/Release/librdkafka.dll to ../build/Releaselibrdkafka.dll
The system cannot find the file specified.
nuget_restore, and also build_dependencies
Unknown command: '....\deps\restore'
NuGet.CommandLine.CommandLineException: Unknown command: '....\deps\restore'
This seems to suggest that something with the node-rdkafka installation script is not quite right.
try npm install [email protected]
@skyfloyd Thank you for the suggestion. I tried that. It didn't quite work and now suggests using VS 2010 (going back in time?).
The first entries that indicate something is not going according to plan are:
Warning: Missing input files:
C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka\win32\outdir\v120x64\Releaselibrdkafkacpp.dll
C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka\win32\outdir\v120x64\Releaselibrdkafka.dll
C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka\win32\outdir\v120x64\Release\zlib.dll
Note that I simplified my setup by creating an empty directory and then executing these commands:
npm init -yThis simplification didn't resolve it either.
However, after removing node.js, npm, all node_modules as well as the respective caches, I got a bit further down the road by executing the following:
windows-build-toolsPath (do not include nuget.exe!)With that in place it still reports the missing files first but then continues to use nuget to get them.
Then the compilation fails with missing headers for OpenSSL. I believe I have seen this elsewhere, so will try to research this for a bit and report back here.
Update: I found some OpenSSL related information here. I downloaded and installed it into C:\OpenSSL-win32. However, the linker step of the node-rdkafka install fails with a several unresolved external symbols similar to the following
libeay32MT.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __iob_func referenced in function OPENSSL_stderr [C:\projects\tests\kafka\node
_modules\node-rdkafka\depslibrdkafka\win32librdkafka.vcxproj] [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka.vcxproj]
libeay32MT.lib(ui_openssl.obj) : error LNK2001: unresolved external symbol __iob_func [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafk
a\win32librdkafka.vcxproj] [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka.vcxproj]
ssleay32MT.lib(t1_enc.obj) : error LNK2001: unresolved external symbol __iob_func [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka\wi
n32librdkafka.vcxproj] [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka.vcxproj]
libeay32MT.lib(txt_db.obj) : error LNK2001: unresolved external symbol __iob_func [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka\wi
n32librdkafka.vcxproj] [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka.vcxproj]
libeay32MT.lib(cryptlib.obj) : error LNK2019: unresolved external symbol sscanf referenced in function OPENSSL_cpuid_setup [C:\projects\tests\kafka\nod
e_modules\node-rdkafka\depslibrdkafka\win32librdkafka.vcxproj] [C:\projects\tests\kafka\node_modules\node-rdkafka\depslibrdkafka.vcxproj]
...
Question: where does the node-rdkafka installer expect OpenSSL to be located during install (ie the link step)? Also, is version 1.0.2 the correct version?
@ManfredLange github doesn't allow me to attache exe file. Please find Win64OpenSSL-1_0_2o.exe in the internet and it will does everything for you. In my case it is installed in C:\OpenSSL-Win64 and there is OPENSSL_CONF : C:\OpenSSL-Win64\bin\openssl.cfg in system variables.
We had this exact same issue recently, can confirm using 2.3.4 (with VS2010 and OpenSSL set up as required) allows the install to complete successfully. I assume something about the Windows build changed between 2.3.4 and the current version?
@skyfloyd I found version 1.0.2p but haven't been able to locate version 1.0.2o. Do you happen to have a URL for the latter? Thank you!
Alternatively, please send email (see my github profile) and we can then figure out how to get the file that you have across. That'd be awesome.
@ManfredLange I sent it by email. Doesn't Win64 OpenSSL v1.0.2p work?
@ManfredLange hmmm, sorry gmail doesn't allow me to send it by email This message was blocked because its content presents a potential security issue. Please try 1.0.2p, I believe it must work as well.
@skyfloyd and @t-davies Thank you both for your suggestions. Very much appreciated!
Based on your comments and other sources I was able to make it work with the following approach in my own environment as well in other team members' environments:
node.jsC:\Users\Manfred\AppData\Roaming\npm-cache. In my case there was/is also a directory named C:\Users\Manfred\AppData\Roaming\npm. Also check C:\Program Files\nodejs. If any of these directories exist after uninstall, remove them manually. In my environment with multiple installs/uninstalls/reinstalls it was messed up at some point.npm install -g [email protected] (or newer version). Important: Install globally with flag -g.Path environment variable. In my case (all defaults) this was located at C:\Program Files (x86)\MSBuild\12.0\Bin. Important: Do not use any of the other versions that you may have. The path must contain 12.0 otherwise you will be using the wrong version. I tested version 14.0 which resulted in compiler or linker errors.Path environment variable. Also create a new environment variable named "Python" that contains the path including the full name of the executable. In my case this was C:\bin\python27\python.exe.nuget.exe version 4.6.2 or later from here. Version 4.7.1 is recommended as of writing.Path environment variable1.0.2o or version 1.0.2p.Here are some checks you can run to determine your chances of a successful install. If any of these tests fail, the install is unlikely to succeed.
node -v and confirm it is version 8.12.0 or laternpm -v and confim it is version 6.4.1 or laternuget and confirm it is version 4.6.2 or latermsbuild and confirm it is version 12.0.x.y (but nothing newer/older!!)python and confirm it is version 2.7.x (3.x or later will not work)Execute npm install [email protected].
Assuming I haven't missed an important step this should now work. It did in our environments, i.e. more than one Windows based development machine.
Most helpful comment
@skyfloyd and @t-davies Thank you both for your suggestions. Very much appreciated!
Based on your comments and other sources I was able to make it work with the following approach in my own environment as well in other team members' environments:
A. Installing Prerequisites
node.jsC:\Users\Manfred\AppData\Roaming\npm-cache. In my case there was/is also a directory namedC:\Users\Manfred\AppData\Roaming\npm. Also checkC:\Program Files\nodejs. If any of these directories exist after uninstall, remove them manually. In my environment with multiple installs/uninstalls/reinstalls it was messed up at some point.npm install -g [email protected](or newer version). Important: Install globally with flag-g.Pathenvironment variable. In my case (all defaults) this was located atC:\Program Files (x86)\MSBuild\12.0\Bin. Important: Do not use any of the other versions that you may have. The path must contain12.0otherwise you will be using the wrong version. I tested version14.0which resulted in compiler or linker errors.Pathenvironment variable. Also create a new environment variable named "Python" that contains the path including the full name of the executable. In my case this wasC:\bin\python27\python.exe.nuget.exeversion 4.6.2 or later from here. Version 4.7.1 is recommended as of writing.Pathenvironment variable1.0.2oor version1.0.2p.B. Pre-Build Checks
Here are some checks you can run to determine your chances of a successful install. If any of these tests fail, the install is unlikely to succeed.
node -vand confirm it is version8.12.0or laternpm -vand confim it is version6.4.1or laternugetand confirm it is version4.6.2or latermsbuildand confirm it is version12.0.x.y(but nothing newer/older!!)pythonand confirm it is version2.7.x(3.x or later will not work)C. Build
Execute
npm install [email protected].Assuming I haven't missed an important step this should now work. It did in our environments, i.e. more than one Windows based development machine.