Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

495
Visualizações
auto generate GRPC file in Ubntu os and Nodejs ( typescript ) project

i have ubuntu os on my PC .

previous os was windows 10 .

i have a project nodejs and typescript .

now i want to use GRPC in my project. when i want to generate GRPC files i use this commend :

    const path = require('path');
const shell = require('shelljs');
const rimraf = require('rimraf');
// https://github.com/shelljs/shelljs/issues/469
process.env.PATH += (path.delimiter + path.join(process.cwd(), 'node_modules', '.bin'));

const PROTO_DIR = './../src/Utilities/GRPC/Protos';
const MODEL_DIR =  './../src/Utilities/GRPC/models';
const PROTOC_PATH = './../node_modules/grpc-tools/bin/protoc';
const PLUGIN_PATH =  './../node_modules/.bin/protoc-gen-ts_proto';

rimraf.sync(`${MODEL_DIR}/*`, {
  glob: { ignore: `${MODEL_DIR}/tsconfig.json` },
});

const protoConfig = [
  `--plugin=${PLUGIN_PATH}`,

  // https://github.com/stephenh/ts-proto/blob/main/README.markdown
  "--ts_proto_opt=outputServices=grpc-js,env=node,useOptionals=true,exportCommonSymbols=false,esModuleInterop=true",

  `--ts_proto_out=${MODEL_DIR}`,
  `--proto_path ${PROTO_DIR} ${PROTO_DIR}/*.proto`,
];
// https://github.com/stephenh/ts-proto#usage
shell.exec(`${PROTOC_PATH} ${protoConfig.join(" ")}`, (code, stdout, stderr) => console.log(code, stdout, stderr));

now when i run this command it show me this error :

/bin/sh: 1: ./../node_modules/grpc-tools/bin/protoc: not found
127  /bin/sh: 1: ./../node_modules/grpc-tools/bin/protoc: not found

but when i use this command in windows it work correct .

whats the problem ? how can i sovle this problem ?

this my package.json :

"grpc_tools_node_protoc_ts": "^5.3.2",
"grpc-tools": "^1.11.2",
"google-protobuf": "^3.19.3",
"@grpc/grpc-js": "^1.4.5",
"@grpc/proto-loader": "^0.6.9",
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda