grpc-node: Fails to install grpc@1.17.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`

The problem occurs when doing npm install of a project.

Environment

Angular CLI: 1.7.4 Node: 9.2.0 OS: win32 x64 Windows 10 Angular: 5.0.3 … animations, common, compiler, core, forms, http … platform-browser, platform-browser-dynamic, router

@angular/cli: 1.7.4 @angular/compiler-cli: 5.2.11 @angular/language-service: 5.2.11 @angular-devkit/build-optimizer: 0.3.2 @angular-devkit/core: 0.3.2 @angular-devkit/schematics: 0.3.2 @ngtools/json-schema: 1.2.0 @ngtools/webpack: 1.10.2 @schematics/angular: 0.3.2 @schematics/package-update: 0.3.2 typescript: 2.5.3 webpack: 3.11.0 npm:6.5.0

Additional context

I attach the result and log

error completo.txt 2019-01-04T20_35_36_697Z-debug.log

E:\TFStudio\Repos\idepWeb\node_modules\grpc\build\Release\\libz.lib
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\Emilse\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Emilse\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=E:\\TFStudio\\Repos\\idepWeb\\node_modules\\grpc\\src\\node\\extension_binary\\node-v59-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\\TFStudio\\Repos\\idepWeb\\node_modules\\grpc\\src\\node\\extension_binary\\node-v59-win32-x64-unknown" "--node_abi_napi=node-v59" "--napi_build_version=0" "--node_napi_label=node-v59"
gyp ERR! cwd E:\TFStudio\Repos\idepWeb\node_modules\grpc
gyp ERR! node -v v9.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\Emilse\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=E:\TFStudio\Repos\idepWeb\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\TFStudio\Repos\idepWeb\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown --node_abi_napi=node-v59 --napi_build_version=0 --node_napi_label=node-v59' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (E:\TFStudio\Repos\idepWeb\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "E:\\TFStudio\\Repos\\idepWeb\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd E:\TFStudio\Repos\idepWeb\node_modules\grpc
node-pre-gyp ERR! node -v v9.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\Emilse\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=E:\TFStudio\Repos\idepWeb\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\TFStudio\Repos\idepWeb\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown --node_abi_napi=node-v59 --napi_build_version=0 --node_napi_label=node-v59' (1)
npm WARN angular-calendar@0.17.4 requires a peer of @angular/animations@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-calendar@0.17.4 requires a peer of @angular/common@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-calendar@0.17.4 requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-calendar@0.17.4 requires a peer of @angular/platform-browser@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-highcharts@4.1.2 requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler-cli@5.2.11 requires a peer of @angular/compiler@5.2.11 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.17.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.17.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Emilse\AppData\Roaming\npm-cache\_logs\2019-01-04T20_24_52_759Z-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 28 (3 by maintainers)

Most upvoted comments

@FutureHits3Dev I deleted “firebase”: “^5.8.3”, “firebase-admin”: “^8.6.1”, “firebase-functions”: “^3.3.0”, “firebaseauth”: “^1.0.0”

But I think the error is caused by firebase-functions

npm install --save node-pre-gyp in the problematic project works - you essentially have to treat it like a peer dependency because of the compilation difficulties on Windows.

This is what people are referring to by “use the pre-compiled binaries” as well 😃

is there a solution for this?

This answer helped me. So I just downgraded node (with nvm) and it worked!

Windows 10 x64 here with node 14: npm install --save node-pre-gyp did the trick 😃

downgrading node to v11 worked

downgrading node to v11 worked

I changed node to 10.16.3, also worked. It failed at 12.12.0 before.

Work fine with node 10.16.3

downgrading node to v11 worked

I changed node to 10.16.3, also worked. It failed at 12.12.0 before.

The grpc package is now deprecated, so we will not be making any fixes to address this. We recommend instead using @grpc/grpc-js, which won’t have this kind of problem.

I am getting the same error when running npm install for a project file. There was a huge console log but these are the major parts of the output

../deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc: In function ‘grpc_error* try_http_parsing(grpc_chttp2_transport*)’:
../deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc:2466:40: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘grpc_http_response’ {aka ‘struct grpc_http_response’}; use assignment or value-initialization instead [-Werror=class-memaccess]
 2466 |   memset(&response, 0, sizeof(response));
      |                                        ^
In file included from ../deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc:44:
../deps/grpc/src/core/lib/http/parser.h:71:16: note: ‘grpc_http_response’ {aka ‘struct grpc_http_response’} declared here
   71 | typedef struct grpc_http_response {
      |                ^~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [grpc.target.mk:496: Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.o] Error 1
make: Leaving directory '/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.0-7634-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/razor/main/Requestly/requestly-master/app/node_modules/grpc
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 5.4.0-7634-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/razor/main/Requestly/requestly-master/app/node_modules/grpc
node-pre-gyp ERR! node -v v12.18.1
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/razor/main/Requestly/requestly-master/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/karma/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.6 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.19.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the grpc@1.19.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/razor/.npm/_logs/2020-07-31T02_04_31_133Z-debug.log

OS: Pop!_OS 20.04 LTS node --version : v12.18.1 'npm -v` : 6.14.5 log_file: 2020-07-31T02_04_31_133Z-debug.log

I deleted everything in my ./node_modules folder, removed firebase from my package.json file, and I ran npm i again. That fixed my issue with this.

Deleting unused firebase modules worked for me.