Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Instructions Incorrect / go get fails #211

Closed
vedantroy opened this issue Feb 9, 2020 · 11 comments
Closed

Installation Instructions Incorrect / go get fails #211

vedantroy opened this issue Feb 9, 2020 · 11 comments

Comments

@vedantroy
Copy link

What version of the package or command are you using?

Not sure how to check. I just ran go get github.com/mholt/archiver/v3

What are you trying to do?

Install the package and use it.

What steps did you take?

Installed go on Windows.
Ran go get github.com/mholt/archiver/v3

What did you expect to happen, and what actually happened instead?

The package should successfully install.

This happened instead:

package github.com/mholt/archiver/v3: cannot find package "github.com/mholt/archiver/v3" in any of:
        c:\go\src\github.com\mholt\archiver\v3 (from $GOROOT)
        C:\Users\vroy1\go\src\github.com\mholt\archiver\v3 (from $GOPATH)

Doing go get github.com/mholt/archiver works better and throws the following error instead:

C:\Users\vroy1\Desktop\server>go get github.com/mholt/archiver/  
package github.com/pierrec/lz4/v3: cannot find package "github.com/pierrec/lz4/v3" in any of:
        c:\go\src\github.com\pierrec\lz4\v3 (from $GOROOT)
        C:\Users\vroy1\go\src\github.com\pierrec\lz4\v3 (from $GOPATH)

Please link to any related issues, pull requests, and/or discussion

#195

@NightMachinery
Copy link

NightMachinery commented May 19, 2020

github.com/mholt/archiver (download)
github.com/andybalholm/brotli (download)
github.com/dsnet/compress (download)
github.com/golang/snappy (download)
github.com/klauspost/compress (download)
github.com/klauspost/pgzip (download)
github.com/nwaples/rardecode (download)
github.com/pierrec/lz4 (download)
package github.com/pierrec/lz4/v3: cannot find package "github.com/pierrec/lz4/v3" in any of:
        /home/linuxbrew/.linuxbrew/Cellar/go/1.14.2_1/libexec/src/github.com/pierrec/lz4/v3 (from $GOROOT)
        /home/eva/go/src/github.com/pierrec/lz4/v3 (from $GOPATH)
github.com/ulikunitz/xz (download)
github.com/xi2/xz (download)

@semilin
Copy link

semilin commented May 26, 2020

I have found a very crude way of fixing this before a patch is made.

  1. go get -u github.com/mholt/archiver
    This will return an error, that is ok.
  2. cd $GOPATH/src/github.com/mholt/archiver/
  3. A couple of files will contain github.com/mholt/archiver/v3 in the import command. Remove the /v3 from these import files:
  • lz4.go
  • tarzl4.go
  • tar_test.go (this one has github.com/mholt/archiver/v3 instead, do the same here)
  1. Run go get -u github.com/mholt/archiver again.
    This should install with now errors.

@LiuWeiMr
Copy link

Is sloved? I hava same problem.

@coolaj86
Copy link
Collaborator

coolaj86 commented Sep 19, 2020

Install with Go

Install Go (if you don't have it)

Mac, Linux

curl https://webinstall.dev/golang | bash

Windows 10

curl.exe -A MS https://webinstall.dev/golang | powershell

Build archiver as arc

mkdir -p ~/github.com/mholt/
git clone https://github.com/mholt/archiver ~/github.com/mholt/archiver
pushd ~/github.com/mholt/archiver/
export CGO_ENABLED=0
go build -o arc cmd/arc/*.go

Install without Go

Mac, Linux

curl https://webinstall.dev/arc | bash

Windows 10

curl.exe -A MS https://webinstall.dev/arc | powershell

webi (Webinstall.dev) uses the Github releases API to download the arc binary to ~/.local/bin/arc and then updates your PATH.

@Dean-Coakley
Copy link
Contributor

@coolaj86 Can this be closed or is there more details to add to: https://github.com/mholt/archiver#install ?

@coolaj86
Copy link
Collaborator

coolaj86 commented Oct 8, 2020

@Dean-Coakley Yes, this was fixed in #236 and I forgot to close it out. Thanks.

@coolaj86 coolaj86 closed this as completed Oct 8, 2020
@AshDevFr
Copy link

This issue was closed but I still experience the issue when trying to use the library with Go:

$ go get github.com/mholt/archiver/v3
cannot find package "github.com/mholt/archiver/v3" in any of:
        /usr/local/opt/go/libexec/src/github.com/mholt/archiver/v3 (from $GOROOT)
        /Users/user1/.go/src/github.com/mholt/archiver/v3 (from $GOPATH)

$ go get github.com/mholt/archiver
cannot find package "github.com/pierrec/lz4/v3" in any of:
        /usr/local/opt/go/libexec/src/github.com/pierrec/lz4/v3 (from $GOROOT)
        /Users/user1/.go/src/github.com/pierrec/lz4/v3 (from $GOPATH)

Am I missing some step here?

@coolaj86
Copy link
Collaborator

coolaj86 commented Oct 11, 2020

You probably need to run go mod init yourpackagenamegoeshere In the root of your package.

@coolaj86
Copy link
Collaborator

coolaj86 commented Oct 11, 2020

Also, you may need to upgrade to a recent version of Go or explicitly set GO111MODULE=on.

If you are just trying to install it as a binary, you can also use the github downloads or https://webinstall.dev/arc

@coolaj86
Copy link
Collaborator

coolaj86 commented Oct 11, 2020

Also, it looks like you may have installed Go from brew or some other package manager that gave you a modified version. I highly discourage that.

I’d recommend using https://webinstall.dev/golang which uses unadulterated official tar and zip packages from golang.org, and won’t mess up /usr/local permissions like the .pkg does.

If your .bashrc or .profile or .zshrc have been modified by brew you may need to manually inspect them, back them up, and remove any GO* variables that you see.

@AshDevFr
Copy link

Thank you for the help, I switched from a brew version to using the curl command and it seems to have fixed it.
Really good to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants