Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get: "--grpc_out: protoc-gen-grpc: The system cannot find the path specified." message?

Tags:

cmd

grpc

I am following this C# Quickstart tutorial for gRPC. I have come to this step where I have to use the following command to generate gRPC code:

%UserProfile%\.nuget\packages\Grpc.Tools.1.15.0\tools\windows_x86\protoc.exe -I../../protos --csharp_out Greeter --grpc_out Greeter ../../protos/helloworld.proto --plugin=protoc-gen-grpc=%UserProfile%\.nuget\packages\packages\Grpc.Tools.1.15.0\tools\windows_x86\grpc_csharp_plugin.exe

It doesn't work and what I get in the terminal after running commands above is this:

--grpc_out: protoc-gen-grpc: The system cannot find the path specified.

I don't know why the system cannot find the path since I have changed the path in the command so that it points to the files which need to be executed.

like image 250
Gal Eržen Pajič Avatar asked Nov 05 '18 16:11

Gal Eržen Pajič


4 Answers

Can you try passing an absolute path to --plugin=protoc-gen-grpc=?

like image 66
Noah Eisen Avatar answered Oct 14 '22 23:10

Noah Eisen


I considered the answer by Michael. However, using a different user account was not an option and I couldn't rename my user account since it's an Azure AD user and as such does not have an entry in the Windows list of local users where I would change its folder location in the registry.

The work-around that did it for me was to change the location of the global packages folder.

like image 26
bgh Avatar answered Oct 15 '22 01:10

bgh


I ran into the same problem, and with this error "path not found" and your name containing special characters as well, I suspected an issue with non ASCII paths! It happened that my windows username had a special character "ë" in it

You should create a github issue, but here are some quick fixes:

2 solutions here to fix the issue

  1. Create a new user without special characters and use this account
  2. Harder and dangerous path, but what I've done myself: rename your user account to remove special characters using the following method https://winaero.com/blog/rename-user-profile-folder-windows-10/
like image 44
Michael Avatar answered Oct 14 '22 23:10

Michael


I had the same error because had cyrillyc symbols in my user folder. Solved by changing path to global nuget packages in nuget file config (for Windows: %appdata%\NuGet\NuGet.config):

<configuration>
  <config>
    <add key="globalPackagesFolder" value="D:\.nuget\packages" />
  </config>
</configuration>

Instead of D:\.nuget\packages you can set any path without wrong symbols

like image 24
Roman Yakhmenev Avatar answered Oct 15 '22 00:10

Roman Yakhmenev