Home > Net >  Go install command show 404 error when trying to install module from github
Go install command show 404 error when trying to install module from github

Time:08-26

I developed a go module and pushed it to github, when I am trying to install it with the go install command its showing

go: downloading github.com/hvuhsg/lokidbServer v0.0.0-20220825205442-250079f3d6e9
go: github.com/hvuhsg/lokidbServer/cmd/lokidb.go@latest: github.com/hvuhsg/[email protected]: verifying module: github.com/hvuhsg/[email protected]: reading https://sum.golang.org/lookup/github.com/hvuhsg/[email protected]: 404 Not Found
    server response:
    not found: github.com/hvuhsg/[email protected]: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/023bef7fbf7701c1dd80019746ac35a6d71aa94fa9b3961e0dadef371238a56e: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
    Confirm the import path was entered correctly.
    If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

P.S: the repo is public

The full command is

go install github.com/hvuhsg/lokidbServer/cmd/lokidb.go@latest

CodePudding user response:

You can install it like this: go install github.com/hvuhsg/lokidbServer/cmd@latest

If the repo is yours, I would recommend adding a folder lokidb to the cmd folder, and put the main package inside of it.

Check this repo as an example:

go install github.com/fraugster/parquet-go/cmd/csv2parquet@latest

Another option is to add a file to the root of the directory, like its done here (in this case, the package inside go.mod is defined as github.com/vektra/mockery/v2):

go install github.com/vektra/mockery/v2@latest
  • Related