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.

Can't install grpc m1 Mac

See original GitHub issue

Problem description

Run into a bunch of errors while installing grpc

Reproduction steps

The package.json of our project contains grpc. When I run npm install, this is the full output of the error:

npm ERR! code 1
npm ERR! path /Users/xxx/node_modules/grpc
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_trace.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz_registry.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/status_util.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/format_request.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/parser.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/buffer_list.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/call_combiner.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/combiner.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_uv.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epoll1_linux.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollex_linux.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_poll_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/exec_ctx.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/executor.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_fallback.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_host_name_max.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_sysconf.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/internal_errqueue.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iocp_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_internal.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_uv.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/is_epollexclusive_available.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/load_file.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/lockfree_event.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/polling_entity.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_uv.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resource_quota.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/sockaddr_utils.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_factory_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_mutator.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_common_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_linux.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_uv.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_uv.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_windows.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/time_averaged_stats.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_custom.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_generic.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_heap.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_manager.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_uv.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/udp_server.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_pipe.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_posix.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_reader.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_string.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_writer.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/b64.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/percent_encoding.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_buffer.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_intern.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_string_helpers.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/api_trace.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer_reader.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_details.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_log_batch.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_init.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_ping.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_stack_type.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue_factory.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/event_string.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/lame_client.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/metadata_array.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/server.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/validate_metadata.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/version.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/bdp_estimator.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/byte_stream.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/connectivity_state.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/error_utils.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata_batch.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/pid_controller.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/static_metadata.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/status_conversion.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/status_metadata.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/timeout_encoding.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport_op_string.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/uri/uri_parser.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/trace.o
npm ERR!   CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.o
npm ERR! 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=/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.13.0
npm ERR! node-pre-gyp info using node@14.16.0 | darwin | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown/grpc_node.node" (not found)
npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.20.2/node-v83-darwin-x64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.20.2/node-v83-darwin-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.20.2/node-v83-darwin-x64-unknown.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not found for grpc@1.20.2 and node@14.16.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.20.2/node-v83-darwin-x64-unknown.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.16.0 | darwin | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.16.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/node_modules/grpc/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/xxx/Library/Caches/node-gyp/14.16.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/xxx/Library/Caches/node-gyp/14.16.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/xxx/Library/Caches/node-gyp/14.16.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/xxx/node_modules/grpc',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.16.0 | darwin | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../deps/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc:35:
npm ERR! In file included from ../deps/grpc/src/core/lib/security/context/security_context.h:27:
npm ERR! ../deps/grpc/src/core/lib/security/credentials/credentials.h:155:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage]
npm ERR! typedef struct {
npm ERR!               ^
npm ERR!                grpc_credentials_mdelem_array
npm ERR! ../deps/grpc/src/core/lib/security/credentials/credentials.h:156:21: note: type is not C-compatible due to this default member initializer
npm ERR!   grpc_mdelem* md = nullptr;
npm ERR!                     ^~~~~~~
npm ERR! ../deps/grpc/src/core/lib/security/credentials/credentials.h:158:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
npm ERR! } grpc_credentials_mdelem_array;
npm ERR!   ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! 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=/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
npm ERR! gyp ERR! cwd /Users/xxx/node_modules/grpc
npm ERR! gyp ERR! node -v v14.16.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! 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=/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v83-darwin-x64-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/xxx/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! node-pre-gyp ERR! System Darwin 20.6.0
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/xxx/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd /Users/xxx/node_modules/grpc
npm ERR! node-pre-gyp ERR! node -v v14.16.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.13.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2021-08-11T20_11_18_947Z-debug.log

Environment

  • macOS Big Sur, Version 11.5.1 and Apple M1
  • node: v14.16.0
  • npm: 7.16.0
  • gRPC@^1.20.2

Additional context

I have encountered errors with gRPC on this M1 machine with Python as well.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
handhikadjcommented, Feb 4, 2022

+1

I have a project in which grpc is not listed on package.json but I can see in terminal it’s installing grpc. it failed eventually

please help

ERROR MESSAGE
error /Users/xxx/node_modules/grpc: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: /Users/xxx/node_modules/grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.12.0
node-pre-gyp info using node@16.13.2 | darwin | arm64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/Users/xxx/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node" (not found)
node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-darwin-arm64-unknown.tar.gz
node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-darwin-arm64-unknown.tar.gz
node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-darwin-arm64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for grpc@1.20.0 and node@16.13.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-darwin-arm64-unknown.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.13.2 | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.13.2 | darwin | arm64
gyp info find Python using Python version 3.9.9 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/xxx/node_modules/grpc/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/handika/Library/Caches/node-gyp/16.13.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/handika/Library/Caches/node-gyp/16.13.2',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/handika/Library/Caches/node-gyp/16.13.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/xxx/node_modules/grpc',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.13.2 | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', '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/lib/channel/channel_stack.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/status_util.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o
../deps/grpc/src/core/lib/debug/stats_data.cc:284:5: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
    "requested the incoming call",
    ^
../deps/grpc/src/core/lib/debug/stats_data.cc:283:5: note: place parentheses around the string literal to silence warning
    "How many completion queues were checked looking for a CQ that had "
    ^
1 error generated.
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o] Error 1
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/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 21.1.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/handika/Sites/vue-cuelist/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/handika/Sites/vue-cuelist/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
gyp ERR! cwd /Users/xxx/node_modules/grpc
gyp ERR! node -v v16.13.2
gyp ERR! node-gyp -v v8.4.1
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/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/handika/Sites/vue-cuelist/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/handika/Sites/vue-cuelist/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/handika/Sites/vue-cuelist/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
node-pre-gyp ERR! System Darwin 21.1.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/handika/Sites/vue-cuelist/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/xxx/node_modules/grpc
node-pre-gyp ERR! node -v v16.13.2
node-pre-gyp ERR! node-pre-gyp -v v0.12.0

I’m on the latest stable nodejs (v16.x)

6reactions
BWStearnscommented, Feb 16, 2022

Same issue here but on an intel mac.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I install GRPCIO on an Apple M1 Silicon laptop?
This seems to work well, do the following in the terminal export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1.
Read more >
How do I install grpcio on m1 Mac? - Ask Different
When googling with gRPC in mind, I found answer: export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1.
Read more >
How to install grpcio Python on Mac (2022) - YouTube
Your browser can't play this video. ... MacBook Tutorial. How to install grpcio Python on Mac (2022) | gRPC Remote Procedure Call (RPC) ......
Read more >
Protocol Buffer Compiler Installation - gRPC
Warning · Linux, using apt or apt-get , for example: $ apt install -y protobuf-compiler $ protoc --version # Ensure compiler version is...
Read more >
grpcio-tools - PyPI
Installation. The gRPC Python tools package is available for Linux, Mac OS X, and Windows. ... You cannot currently install Python from source...
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