grpc-js-typescript icon indicating copy to clipboard operation
grpc-js-typescript copied to clipboard

Can't run compile-proto.sh

Open MertIV opened this issue 2 years ago • 3 comments

Hello, thanks for the effort you've been giving to this project. Its been really helpful for me.

But I couldn't generate proto files from the script you've written in windows even though bash is installed. Can you help me with that?

MertIV avatar Nov 22 '21 23:11 MertIV

Hi the current error I'm getting is

PS C:\Users\mrtkr\Documents\GitHub\grpc-js-typescript\examples\ts-protoc-gen> node_modules/.bin/grpc_tools_node_protoc -I="./" --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --plugin=protoc-gen-grpc=./node_modules/.bin/protoc-gen-grpc --js_out=import_style=commonjs:. --grpc_out=grpc_js:. --ts_out=grpc_js:. ./proto/example.proto C:\Users\mrtkr\Documents\GitHub\grpc-js-typescript\examples\ts-protoc-gen\node_modules\grpc-tools\bin\protoc.js:41 throw error; ^

Error: Command failed: C:\Users\mrtkr\Documents\GitHub\grpc-js-typescript\examples\ts-protoc-gen\node_modules\grpc-tools\bin\protoc.exe --plugin=protoc-gen-grpc=C:\Users\mrtkr\Documents\GitHub\grpc-js-typescript\examples\ts-protoc-gen\node_modules\grpc-tools\bin\grpc_node_plugin.exe -I=./ --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --plugin=protoc-gen-grpc=./node_modules/.bin/protoc-gen-grpc --js_out=import_style=commonjs:. --grpc_out=grpc_js:. --ts_out=grpc_js:. ./proto/example.proto

at ChildProcess.exithandler (child_process.js:383:12)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) {

killed: false, code: 3221225477, signal: null, cmd: 'C:\Users\mrtkr\Documents\GitHub\grpc-js-typescript\examples\ts-protoc-gen\node_modules\grpc-tools\bin\protoc.exe --plugin=protoc-gen-grpc=C:\Users\mrtkr\Documents\GitHub\grpc-js-typescript\examples\ts-protoc-gen\node_modules\grpc-tools\bin\grpc_node_plugin.exe -I=./ --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --plugin=protoc-gen-grpc=./node_modules/.bin/protoc-gen-grpc --js_out=import_style=commonjs:. --grpc_out=grpc_js:. --ts_out=grpc_js:. ./proto/example.proto' }

Like this I've tried to modify the script but I couldn't run it successfully

MertIV avatar Nov 24 '21 11:11 MertIV

Apologies for the belated response. I'll add some windows scripts to help with this when i get some time, in the meantime have you tried using the grpc-proto-loader as it does not use the proto compiler.

badsyntax avatar Nov 24 '21 12:11 badsyntax

Hello,

Yeah, I've tried it and managed to run successfully thank you. I'll be much more appreciated if I could run with the compiler. Thank you again.

24 Kas 2021 Çar 15:17 tarihinde Richard Willis @.***> şunu yazdı:

Apologies for the belated response. I'll add some windows scripts to help with this when i get some time, in the meantime have you tried using the grpc-proto-loaded https://github.com/badsyntax/grpc-js-typescript/tree/master/examples/grpc-proto-loader as it does not use the proto compiler.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/badsyntax/grpc-js-typescript/issues/34#issuecomment-977823112, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKK4FPCWL25FRWJA2R7AJBLUNTJW3ANCNFSM5ISG54UA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MertIV avatar Nov 24 '21 13:11 MertIV