Abd*_*mer 11 node.js npm yarnpkg grpc-node apple-m1
用于安装的命令:
npm install -g grpc-工具
纱线添加全局 grpc-tools
尝试在 mac m1 BigSur 上安装 grpc-tools 时。我遇到了下面粘贴的错误:
npm ERR! code 1
npm ERR! path /Users/abdulmoiz_ahmer/.nvm/versions/node/v16.13.1/lib/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.8
npm ERR! node-pre-gyp info using node@16.13.1 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/abdulmoiz_ahmer/.nvm/versions/node/v16.13.1/lib/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/abdulmoiz_ahmer/.nvm/versions/node/v16.13.1/lib/node_modules/grpc-tools/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 20.4.0
npm ERR! node-pre-gyp ERR! command "/Users/abdulmoiz_ahmer/.nvm/versions/node/v16.13.1/bin/node" "/Users/abdulmoiz_ahmer/.nvm/versions/node/v16.13.1/lib/node_modules/grpc-tools/node_modules/.bin/node-pre-gyp" "install"
npm ERR! node-pre-gyp ERR! cwd /Users/abdulmoiz_ahmer/.nvm/versions/node/v16.13.1/lib/node_modules/grpc-tools
npm ERR! node-pre-gyp ERR! node -v v16.13.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
npm ERR! node-pre-gyp ERR! not ok
Run Code Online (Sandbox Code Playgroud)
Clé*_*ean 13
我通过将 npm_config_target_arch 明确设置为 x64 来使其工作,这可能不是最好的解决方案,但目前这就是我发现的全部。npm install我这样运行:
npm_config_target_arch=x64 npm i grpc-tools
Run Code Online (Sandbox Code Playgroud)
如果我找到更好的方法,我会更新该答案。
我可以通过强制 x64 二进制文件并让 BigSur 处理它来解决这个问题:
yarn add grpc-tools --ignore-scripts
pushd node_modules/grpc-tools
node_modules/.bin/node-pre-gyp install --target_arch=x64
popd
Run Code Online (Sandbox Code Playgroud)
如果有人能找到正常的安装方法,我们将不胜感激。
| 归档时间: |
|
| 查看次数: |
8135 次 |
| 最近记录: |