npm install grpc build from source fails
See original GitHub issueHaving the issue on Fedora 29
Node: 10.16.0 npm: 6.9.0
Console output (abridged):
npm install grpc
grpc@1.21.1 install /home/gary/Source/storex_graphql_server/node_modules/grpc node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Tried to download(400): https://node-precompiled-binaries.grpc.io/grpc/v1.21.1/node-v64-linux-x64-glibc.tar.gz node-pre-gyp WARN Pre-built binaries not found for grpc@1.21.1 and node@10.16.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) make: Entering directory ‘/home/gary/Source/storex_graphql_server/node_modules/grpc/build’ CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
…
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.o …/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc: In function ‘grpc_grpclb_request* grpc_grpclb_request_create(const char*)’: …/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc:70:10: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 128 equals destination size [-Werror=stringop-truncation] strncpy(req->initial_request.name, lb_service_name,
GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [grpc.target.mk:495: Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.o] Error 1
make: Leaving directory '/home/gary/Source/storex_graphql_server/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.1.11-200.fc29.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/gary/Source/storex_graphql_server/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/gary/Source/storex_graphql_server/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /home/gary/Source/storex_graphql_server/node_modules/grpc
gyp ERR! node -v v10.16.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 '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/gary/Source/storex_graphql_server/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/gary/Source/storex_graphql_server/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/gary/Source/storex_graphql_server/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 5.1.11-200.fc29.x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/home/gary/Source/storex_graphql_server/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/gary/Source/storex_graphql_server/node_modules/grpc
node-pre-gyp ERR! node -v v10.16.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/gary/Source/storex_graphql_server/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/gary/Source/storex_graphql_server/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm WARN basic_server@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.21.1 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.21.1 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/gary/.npm/_logs/2019-06-20T08_52_53_291Z-debug.log
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:16 (1 by maintainers)
Downgrading Node.js from 12 to 10 works as well.
late but anyone who must use needle for downloading:
node-pre-gyp WARN Using needle for node-pre-gyp https download
can fix this issue by installing request first:
npm install request
Then, install grpc as usual:
npm install grpc
This is because node-pre-gyp has the following code snippet during install process:
So request is not used because any package.json does not have request. Pre installing request fixes this issue for me. Important to say that all cafile options must be removed from any npm config ssl can be set to true again as well as NODE_TLS_REJECT_UNAUTHORIZED to true.