/bin/bash: go1.17.8: command not found [Error running up the Server]

When running the server, you may bump into the issue that shows go1.1x.x is not found, although you may have the go-binary already installed.

We have recently imposed the strict versioning of golang for making the consistent build between the server, meshery-extensions and their adapters. This was important to introduce consistency. Furthermore, some previous versions of golang before go-1.17 seems to create few problems with the build.

We want you to use the go version: 1.17.8 but it’s fine if you use any latest like 1.18.x too(though we have not done any stable-tests on it)

To see your go version:

go version

output: go version go1.17.8 linux/amd64

If your go version is fine, you can comment out this line to use your default go binary of your system without imposing version restriction.

Another Option

You may try to download version-specific go binaries and make it executable and store it in your usr/bin where your binaries are located. More information on go-docs

1 Like

I am using go.1.19 linux/amd64 but it is showing me the same error. Why?

It might be that you have golang 1.19 installed, but that you don’t have a binary under the filename of go1.19, which will curse you to see a warning message when running make server. You can test by verifying the output of a which go1.19.

@Antonette.Caldwell is actively considering how this contributor experience might be improved and is a good individual to connect with on the subject, @Rakshit.Gondwal.

which go 1.19

I have the latest version of go; but still I am getting the same error

        go1.19.1 run main.go error.go;
/bin/bash: go1.19.1: command not found
/bin/bash: go1.19.1: command not found

Ensure that which go returns the path to your go binary. You might have to create an alias.

Hi Lee,

I am getting the path when I use which go cmd

 which go

The quickest way to solve this is to use:

go install golang.org/dl/go1.19.1@latest

Reference: Managing Go installations - The Go Programming Language

1 Like

Commenting out the Go version 1.19.1line in the Makefile.core.mk worked for me. I had this doubt that why we have this line in the code if it is bound to create errors. Shouldn’t we just remove this line from the codebase?

So long as you’re running go1.19.x, you shouldn’t have any issue, @Rakshit.Gondwal :+1:

Even after this command

go version

go version go1.19.3 darwin/amd64

My previous go version was 1.19.3 ;

Nope @Lee . I was using 1.19.3 but was facing the same issue. Commenting out the line worked though.