-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc-tools\bin\protoc_plugin.js:37 throw error; #2338
Comments
Is there a way to debug this? |
I have the exact same issue, and I can confirm this is an issue appearing with grpc-tools version 1.12.0. If I try the command with 1.11.3, it runs fine, but not with any of the 1.12 versions. So try running this: Reproduced with both node v14.16.1 and the latest v19.6.0, both installed using nvm for Windows. I have the same issue wether I only type "grpc_tools_node_protoc" or I type the full command with arguments. I know the command syntax is correct, because my grpc_tools_node_protoc command used to work, but since I tried on a fresh Windows install, I can't get the command to work anymore. Also, I tried the static_codegen example it also fails. Here is the output I get, identical as the OP: C:\Users\robil\AppData\Roaming\nvm\v19.6.0\node_modules\grpc-tools\bin\protoc.js:41
throw error;
^
Error: Command failed: C:\Users\robil\AppData\Roaming\nvm\v19.6.0\node_modules\grpc-tools\bin\protoc.exe --plugin=protoc-gen-grpc=C:\Users\robil\AppData\Roaming\nvm\v19.6.0\node_modules\grpc-tools\bin\grpc_node_plugin.exe --js_out=import_style=commonjs binary:../node/static_codegen/ --grpc_out=grpc_js:../node/static_codegen helloworld.proto
at ChildProcess.exithandler (node:child_process:419:12)
at ChildProcess.emit (node:events:512:28)
at maybeClose (node:internal/child_process:1098:16)
at Socket.<anonymous> (node:internal/child_process:456:11)
at Socket.emit (node:events:512:28)
at Pipe.<anonymous> (node:net:316:12) {
code: 3221225781,
killed: false,
signal: null,
cmd: 'C:\\Users\\robil\\AppData\\Roaming\\nvm\\v19.6.0\\node_modules\\grpc-tools\\bin\\protoc.exe --plugin=protoc-gen-grpc=C:\\Users\\robil\\AppData\\Roaming\\nvm\\v19.6.0\\node_modules\\grpc-tools\\bin\\grpc_node_plugin.exe --js_out=import_style=commonjs binary:../node/static_codegen/ --grpc_out=grpc_js:../node/static_codegen helloworld.proto'
}
Node.js v19.6.0 Any hints to make this command work with the latest versions? |
I'm not personally experiencing the issue, but a few days a go, a colleague also run into this. After trying to debug things, we were able to narrow it down to the Prior to downgrading him, we compared hashes of his and my binaries and both were the same (as you'd expect), and after downgrading was then different (also expcted). I suspect that his windows environment is just missing some libs that mine has, but as it stands for now he isn't able to run |
Looks like the cause of this is missing STDC DLLs that must have had some change to how they're packaged with the most recent release. You can fix this by install the Visual Studio 2022 VCTools workload or potentially with a Visual C++ redistributable but I at least know the following works. With choco you can run:
|
I found you need to have these two components installed on Visual Studio Build Tools 2022:
The first one is obvious, but without the second component, |
Problem description
Running protoc_plugin.js result in an error I can't debug or solve.
Reproduction steps
Environment
Additional context
The text was updated successfully, but these errors were encountered: