node-rdkafka fails to install/build on Windows
See original GitHub issueEnvironment Information
- Windows 10 Pro, 64 bit
- Node Version 8.12.0
- NPM Version 6.4.1
- C++ Toolchain: msbuild engine version 12.0.40629.0
- node-rdkafka version commit e82bb2e (latest master as of writing)
- nuget: 4.6.2.5055
- node-gyp 3.8.0
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\deps\librdkafka.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\lic\event-publisher-service\node_modules\node-rdkafka\build\deps....\deps\deps\librdkafka\win32\outdir\v120\x64\Release\zlib.dll C:\projects\hypr\lic\event-publisher-service\node_modules\node-rdkafka\build\deps....\deps\deps\librdkafka\win32\librdkafka.sln C:\projects\hypr\lic\event-publisher-service\node_modules\node-rdkafka\build\deps....\deps\deps\librdkafka\win32\outdir\v120\x64\Release\librdkafkacpp.dll C:\projects\hypr\lic\event-publisher-service\node_modules\node-rdkafka\build\deps....\deps\deps\librdkafka\win32\outdir\v120\x64\Release\librdkafka.dll
Followed later by
Copying deps/librdkafka/win32/outdir/v120/x64/Release/librdkafkacpp.dll to …/build/Release\librdkafkacpp.dll The system cannot find the file specified. Copying deps/librdkafka/win32/outdir/v120/x64/Release/librdkafka.dll to …/build/Release\librdkafka.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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9
Top GitHub Comments
@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.js
C:\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 node-gyp@3.8.0
(or newer version). Important: Install globally with flag-g
.Path
environment 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.0
otherwise you will be using the wrong version. I tested version14.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 wasC:\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 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 -v
and confirm it is version8.12.0
or laternpm -v
and confim it is version6.4.1
or laternuget
and confirm it is version4.6.2
or latermsbuild
and confirm it is version12.0.x.y
(but nothing newer/older!!)python
and confirm it is version2.7.x
(3.x or later will not work)C. Build
Execute
npm install node-rdkafka@2.3.4
.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.
@ManfredLange I wasn’t able to install msbuild 12 from the link provided, instead downloading from here works