question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node-gyp fails for grpc on windows-latest action, with Node 12 and 14

See original GitHub issue
Verbose output (from npm or node-gyp):
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
  win_delay_load_hook.cc
  WINDOWS_BUILD_WARNING.vcxproj -> D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\Release\\WINDOWS_BUILD_WARNING.node
  address_sorting.c
  address_sorting_posix.c
  address_sorting_windows.c
  win_delay_load_hook.cc
  address_sorting.vcxproj -> D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\Release\\libaddress_sorting.lib
  ares__close_sockets.c
  ares__get_hostent.c
##[warning]D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\cares\cares\ares__get_hostent.c(141,32): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\ares.vcxproj]
  ares__read_line.c
  ares__timeval.c
  ares_cancel.c
  ares_create_query.c
  ares_data.c
  ares_destroy.c
  ares_expand_name.c
  ares_expand_string.c
  ares_fds.c
  ares_free_hostent.c
  ares_free_string.c
 ares_platform.c
  ares_process.c
  ares_query.c
  ares_search.c
  ares_send.c
  ares_strcasecmp.c
  ares_strdup.c
  ares_strerror.c
  ares_strsplit.c
  ares_timeout.c
  ares_version.c
  ares_writev.c
  bitncmp.c
  inet_net_pton.c
  inet_ntop.c
  windows_port.c
  win_delay_load_hook.cc
  ares.vcxproj -> D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\Release\\libares.lib
  err_data.c
  a_bitstr.c
##[warning]D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(147,1): warning C4005: 'OPENSSL_VERSION_NUMBER': macro redefinition (compiling source file ..\deps\grpc\src\boringssl\err_data.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
##[error]C:\Users\runneradmin\AppData\Local\node-gyp\Cache\12.16.3\include\node\openssl\ossl_typ.h(92,30): error C2371: 'EVP_MD_CTX': redefinition; different basic types (compiling source file ..\deps\grpc\src\boringssl\err_data.c)D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(303,30): error C2371: 'EVP_MD_CTX': redefinition; different basic types (compiling source file ..\deps\grpc\third_party\boringssl\crypto\asn1\a_bitstr.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\12.16.3\include\node\openssl\ossl_typ.h(92): message : see declaration of 'EVP_MD_CTX' (compiling source file ..\deps\grpc\third_party\boringssl\crypto\asn1\a_bitstr.c)D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(303): note: see declaration of 'EVP_MD_CTX' (compiling source file ..\deps\grpc\src\boringssl\err_data.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
##[error]D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(304,26): error C2371: 'EVP_MD': redefinition; different basic types (compiling source file ..\deps\grpc\third_party\boringssl\crypto\asn1\a_bitstr.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
##[error]C:\Users\runneradmin\AppData\Local\node-gyp\Cache\12.16.3\include\node\openssl\ossl_typ.h(91): message : see declaration of 'EVP_MD' (compiling source file ..\deps\grpc\third_party\boringssl\crypto\asn1\a_bitstr.c)C:\Users\runneradmin\AppData\Local\node-gyp\Cache\12.16.3\include\node\openssl\ossl_typ.h(100,34): error C2371: 'EVP_ENCODE_CTX': redefinition; different basic types (compiling source file ..\deps\grpc\src\boringssl\err_data.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
##[error]D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(308,34): error C2371: 'EVP_ENCODE_CTX': redefinition; different basic types (compiling source file ..\deps\grpc\third_party\boringssl\crypto\asn1\a_bitstr.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\12.16.3\include\node\openssl\ossl_typ.h(100): message : see declaration of 'EVP_ENCODE_CTX' (compiling source file ..\deps\grpc\third_party\boringssl\crypto\asn1\a_bitstr.c)D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(308): note: see declaration of 'EVP_ENCODE_CTX' (compiling source file ..\deps\grpc\src\boringssl\err_data.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
##[error]C:\Users\runneradmin\AppData\Local\node-gyp\Cache\12.16.3\include\node\openssl\crypto.h(231,3): error C2371: 'CRYPTO_THREADID': redefinition; different basic types (compiling source file ..\deps\grpc\src\boringssl\err_data.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]
D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\deps\grpc\third_party\boringssl\include\openssl\base.h(231): message : see declaration of 'CRYPTO_THREADID' (compiling source file ..\deps\grpc\src\boringssl\err_data.c) [D:\a\cloud-trace-nodejs\cloud-trace-nodejs\node_modules\grpc\build\boringssl.vcxproj]

This failure started cropping up with the most recent release of Node 12, and also occurs on Node 14. We continue to be able to compile on Node 10 at latest.

A full failing test run can be found here (GitHub actions makes it difficult to copy the whole terminal).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bcoecommented, May 5, 2020

Talking with Michael, it sounds like this is something that will need to be fixed on the grpc end 👌

1reaction
murgatroid99commented, May 5, 2020

You can’t just build grpc from source on Windows. We screw around with header files when we build the binaries that we distribute, and we don’t expect our users to do that. We do currently distribute binaries for Node 12, so that may be a download failure, but we don’t distribute binaries for Node 14 so I wouldn’t expect that one to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve npm install error “npm ERR! code 1”
If your Node.js version is very recent, try downgrading. The stable version 14.16.1 worked.
Read more >
Solving common issues with node-gyp - LogRocket Blog
Many node-gyp issues are actually issues with the toolchain used for building add-on code. We'll categorize these issues to offer solutions.
Read more >
node-pre-gyp npm - You.com | The Search Engine You Control
Must use desktop, must use windows if possible (Mac layout is weird for some reason) Follow ... gyp and node-pre-gyp fail when installing...
Read more >
Npm install command failing with message "could not find ...
But then, suddenly, it stops with the error: npm ERR! code 1 npm ERR! ... command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm ......
Read more >
mapbox/node-pre-gyp - npm.io
Check @mapbox/node-pre-gyp 1.0.10 package - Last release 1.0.10 with BSD-3-Clause licence at our NPM packages aggregator and search engine.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found