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",