Skip to content
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

How to build this for NodeJS? #109

Open
nebiros opened this issue May 18, 2021 · 0 comments
Open

How to build this for NodeJS? #109

nebiros opened this issue May 18, 2021 · 0 comments

Comments

@nebiros
Copy link

nebiros commented May 18, 2021

This is the command I'm using:

protoc \
        -I . \
        -I /Users/nebiros/go/src \
        -I `go list -m -f "{{.Dir}}" github.com/golang/protobuf` \
        -I `go list -m -f "{{.Dir}}" google.golang.org/protobuf` \
        -I `go list -m -f "{{.Dir}}" github.com/mwitkow/go-proto-validators` \
        --go_out ./gen/go \
        --go_opt paths=source_relative \
        --go-grpc_out ./gen/go \
        --go-grpc_opt paths=source_relative \
        --govalidators_out ./gen/go \
        --govalidators_opt paths=source_relative \
        --grpc-gateway_out ./gen/go \
        --grpc-gateway_opt logtostderr=true \
        --grpc-gateway_opt paths=source_relative \
        --grpc-gateway_opt generate_unbound_methods=true \
        --openapiv2_out ./gen/go \
        --openapiv2_opt logtostderr=true \
        --openapiv2_opt generate_unbound_methods=true \
        --js_out import_style=commonjs,binary,annotate_code,namespace_prefix=challenges:./gen/js \
        --plugin protoc-gen-grpc-node=./node_modules/grpc-tools/bin/protoc_plugin.js \
        --grpc-node_out ./gen/js \
        *.proto

But building the NodeJS side throws me an error: Error: Cannot find module './validator_pb.js'. The file doesn't exist. There's a way to build go-proto-validators for NodeJS? or at least ignore it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant