grpc-tools will not install on an Apple Silicon Mac, or grpc_tools_node_protoc finds no protoc
Your error
response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz2 more lines it can showFix it fast
Most common cause, 1 of 3The grpc-tools version predates its Apple Silicon build
Move to a current grpc-tools.
npm install --save-dev grpc-tools@^1.13.1Short answer
grpc-tools fetches protoc and the gRPC plugin in its install script, node-pre-gyp install. Versions up to 1.11.2 have no darwin-arm64 archive, so Apple Silicon gets a 404; 1.11.3 and later have one. npm 12 holds that script back until you approve it, leaving bin/protoc missing. Upgrade to grpc-tools 1.13, then approve the script and rebuild.
Which cause do you have?
Print the grpc-tools version, the platform and CPU that Node reports, the npm major, and what sits in the package's bin folder. A missing protoc with an old version on darwin-arm64 means the download never existed; a missing protoc on npm 12 with a current version means the script never ran.
npm ls grpc-tools
node -p "process.platform + '-' + process.arch"
npm -v
ls node_modules/grpc-tools/bin/Then find the line you see in this list and open its fix:
- 1The grpc-tools version predates its Apple Silicon build
node -p prints darwin-arm64, npm ls shows grpc-tools 1.11.2 or older, and the install stops on a 404 for a darwin-arm64.tar.gz URL - 2npm 12 skipped the grpc-tools install script
npm -v prints 12.x, the install reported no error, bin/ holds only the .js wrappers, and the first protoc run fails with spawn ... bin/protoc ENOENT - 3No prebuilt binary exists for this platform at all
The 404 names an archive such as linux-arm.tar.gz (32-bit ARM, for example an older Raspberry Pi OS) even on grpc-tools 1.13.1
What does the error look like?
response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gzError: spawn /Users/me/app/node_modules/grpc-tools/bin/protoc ENOENTnpm install grpc-tools finishes, but grpc_tools_node_protoc fails the first time it runs
Cause 1 of 3
The grpc-tools version predates its Apple Silicon build
You seenode -p prints darwin-arm64, npm ls shows grpc-tools 1.11.2 or older, and the install stops on a 404 for a darwin-arm64.tar.gz URL
Check
grpc-tools fails to install on an M1 or later Mac when the pinned version has no darwin-arm64 archive. Its install script downloads a {platform}-{arch}.tar.gz file from node-precompiled-binaries.grpc.io and is not set up to fall back to a source build, so a missing archive ends the install. The host serves darwin-arm64 archives from 1.11.3 onward; a HEAD request for your version's URL shows whether yours exists.
curl -sI https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz | head -n 1
curl -sI https://node-precompiled-binaries.grpc.io/grpc-tools/v1.13.1/darwin-arm64.tar.gz | head -n 1Fix
Move to a current grpc-tools. If another package in the tree pins the old version, upgrade that package as well, since the old pin keeps pulling a version with no arm64 archive.
npm install --save-dev grpc-tools@^1.13.1Verify
The bin folder now holds protoc and grpc_node_plugin, and the wrapper prints a libprotoc version.
ls node_modules/grpc-tools/bin/
npx grpc_tools_node_protoc --versionConfirmed by registry.npmjs.org
Cause 2 of 3
npm 12 skipped the grpc-tools install script
You seenpm -v prints 12.x, the install reported no error, bin/ holds only the .js wrappers, and the first protoc run fails with spawn ... bin/protoc ENOENT
Check
grpc_tools_node_protoc fails with ENOENT on npm 12 because npm no longer runs a dependency's lifecycle scripts unless the root package's allowScripts policy lists it. grpc-tools does its whole setup in that script, so npm unpacks the JavaScript wrappers and never fetches the binaries; the wrapper then tries to start a protoc file that was never written. List what npm held back.
npm install-scripts lsFix
Read the script (it is node-pre-gyp install) and approve grpc-tools; npm rebuild then executes the newly approved download. npm writes the approval into package.json; commit that change.
npm install-scripts approve grpc-tools
npm rebuild grpc-toolsVerify
protoc appears in the bin folder and package.json carries a grpc-tools entry under allowScripts.
ls node_modules/grpc-tools/bin/
grep -A3 '"allowScripts"' package.jsonConfirmed by docs.npmjs.com
Cause 3 of 3
No prebuilt binary exists for this platform at all
You seeThe 404 names an archive such as linux-arm.tar.gz (32-bit ARM, for example an older Raspberry Pi OS) even on grpc-tools 1.13.1
Check
grpc-tools only works where its binary host has an archive for the platform and CPU. darwin-x64, darwin-arm64, linux-x64, linux-arm64 and win32-x64 exist for 1.13.1; a 32-bit ARM Linux request returns 404, and no newer grpc-tools version fixes that.
curl -sI https://node-precompiled-binaries.grpc.io/grpc-tools/v1.13.1/linux-arm.tar.gz | head -n 1Fix
Skip code generation on that machine. Load the .proto file at run time with @grpc/proto-loader, the dynamic approach shown in the gRPC Node.js tutorial, or generate the code on a supported machine and commit the output.
npm install @grpc/grpc-js @grpc/proto-loader
// server.js or client.js
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const def = protoLoader.loadSync(__dirname + '/protos/app.proto', { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true });
const proto = grpc.loadPackageDefinition(def);Verify
The service starts and its methods are reachable without any protoc step on that machine.
node server.jsConfirmed by grpc.io
How do I stop it coming back?
- Keep grpc-tools in devDependencies at a current 1.13.x and let your dependency update bot raise it, so an old pin never meets a new CPU.
- npm install-scripts approve writes a version-pinned allowScripts entry by default; approve again after each grpc-tools upgrade, or use --no-allow-scripts-pin if your review process allows any version.
- Run the protoc generation step in CI on a supported platform and fail the job when bin/protoc is absent.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.