Huddly / sdk

Huddly's Software Development Kit (SDK) used to interact with the camera by third-party applications
MIT License
14 stars 8 forks source link

npm install fails on M1 mac because of missing GRPC dependency #540

Closed RostiMelk closed 2 years ago

RostiMelk commented 2 years ago

Error log:

npm ERR! code 1
npm ERR! path /Users/rostimelk/Projects/testinging/node_modules/grpc-tools
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install
npm ERR! response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.9
npm ERR! node-pre-gyp info using node@16.6.0 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/rostimelk/Projects/testinging/node_modules/grpc-tools/bin/grpc_tools.node" (not found)
npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install error
npm ERR! node-pre-gyp ERR! stack Error: response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! stack     at /Users/rostimelk/Projects/testinging/node_modules/@mapbox/node-pre-gyp/lib/install.js:67:15
npm ERR! node-pre-gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! node-pre-gyp ERR! System Darwin 21.2.0
npm ERR! node-pre-gyp ERR! command "/Users/rostimelk/.nvm/versions/node/v16.6.0/bin/node" "/Users/rostimelk/Projects/testinging/node_modules/.bin/node-pre-gyp" "install"
npm ERR! node-pre-gyp ERR! cwd /Users/rostimelk/Projects/testinging/node_modules/grpc-tools
npm ERR! node-pre-gyp ERR! node -v v16.6.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok

Related issue: https://github.com/grpc/grpc-node/issues/1405

brikendr commented 2 years ago

It appears that the sub dependencies of sdk (@huddly/camera-proto and @huddly/camera-switch-proto) have grpc-tools as a production dependency where in reality it should have been a dev dependency. Updating this will most likely fix the above issue.

eskilgh commented 2 years ago

Unfortunately declaring these dependencies as dev dependencies did not fix the issue at hand. It seems that we are blocked by this issue.

You might have success using one of the approaches in this thread. Or you could try using node version 14.

suenot commented 2 years ago

Try this:

npm_config_target_arch=x64 npm i grpc-tools
npm i

or that:

yarn add grpc-tools --ignore-scripts
pushd node_modules/grpc-tools
node_modules/.bin/node-pre-gyp install --target_arch=x64
popd