-1

I know i shouldn't just throw a question like this and wish i can provide more information, but i am really no idea what it is and it also my first time encounter such issue (after change to new laptop), i think currently i can only provide the error message until someone ask me to provide further info..

When I run the command yarn install at last I am getting below error, tried to install grpc also

error /Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: /Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.13.0
node-pre-gyp info using node@18.12.1 | darwin | x64
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp info check checked for "/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/src/node/extension_binary/node-v108-darwin-x64-unknown/grpc_node.node" (not found)
node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v108-darwin-x64-unknown.tar.gz
node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v108-darwin-x64-unknown.tar.gz
node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v108-darwin-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for grpc@1.23.3 and node@18.12.1 (node-v108 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.23.3/node-v108-darwin-x64-unknown.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@18.12.1 | darwin | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@18.12.1 | darwin | x64
gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args \[
gyp info spawn args   '/usr/local/lib/node_modules/npm/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/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/vishalkumar/Library/Caches/node-gyp/18.12.1/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/vishalkumar/Library/Caches/node-gyp/18.12.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/vishalkumar/Library/Caches/node-gyp/18.12.1/\<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/vishalkumar/Documents/Prudential/one-pulse-app/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@9.1.0
gyp info using node@18.12.1 | darwin | x64
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
clang: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX' \[-Wincompatible-sysroot\]
In file included from ../deps/grpc/src/core/lib/surface/init.cc:19:
In file included from ../deps/grpc/include/grpc/support/port_platform.h:22:
../deps/grpc/include/grpc/impl/codegen/port_platform.h:201:9: warning: 'GRPC_ARES' macro redefined \[-Wmacro-redefined\]
\#define GRPC_ARES 0
^
\<command line\>:3:9: note: previous definition is here
\#define GRPC_ARES 1
^
In file included from ../deps/grpc/src/core/lib/surface/init.cc:32:
In file included from ../deps/grpc/src/core/lib/channel/handshaker_registry.h:26:
In file included from ../deps/grpc/src/core/lib/channel/handshaker_factory.h:26:
In file included from ../deps/grpc/src/core/lib/channel/handshaker.h:35:
In file included from ../deps/grpc/src/core/lib/iomgr/tcp_server.h:30:
In file included from ../deps/grpc/src/core/lib/iomgr/resolve_address.h:26:
../deps/grpc/src/core/lib/iomgr/port.h:211:2: error: "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET"
\#error \
^
1 warning and 1 error generated.
make: \*\*\* \[Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.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/npm/node_modules/node-gyp/lib/build.js:201:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess.\_handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 22.1.0
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/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/src/node/extension_binary/node-v108-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/src/node/extension_binary/node-v108-darwin-x64-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
gyp ERR! cwd /Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v9.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=/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/src/node/extension_binary/node-v108-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/src/node/extension_binary/node-v108-darwin-x64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
node-pre-gyp ERR! stack     at ChildProcess.\<anonymous\> (/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
node-pre-gyp ERR! stack     at ChildProcess.\_handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Darwin 22.1.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc
node-pre-gyp ERR! node -v v18.12.1
node-pre-gyp ERR! node-pre-gyp -v v0.13.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=/Users/vishalkumar/Documents/Prudential/one-pulse-app/node_modules/grpc/src/node/extension_binary/node-v108-d

tried yarn install command

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

0

You are using Node 18 and you are trying to install the grpc package, which was deprecated two years ago and does not support any version of Node greater than 14. The replacement for that package is @grpc/grpc-js.

murgatroid99
  • 19,007
  • 10
  • 60
  • 95