How to resolve ipfs-copy install errors "[ERROR] IPFS Copy requires" and "Error 127" on M1 Mac

I am following the guide at https://blog.infura.io/post/migrate-your-files-to-infuras-new-ipfs-service-in-3-easy-steps on a Mac M1 and have reached Step 2.

When I download and try to install ’ ipfs-copy-v1.0.0-darwin-amd64.tar.gz’ from GitHub I receive the following: ‘[ERROR] IPFS Copy requires (IC_CIDS, --cids) OR (IC_SOURCE_API_URL, --source-api-url) to be defined’

When I try to clone manually and compile I enter ‘make install’ in terminal and receive the following message:
export GO111MODULE=on
env CGO_ENABLED=0 go install -ldflags="-s -w" ./cmd/ipfs-copy/
env: go: No such file or directory
make: *** [install] Error 127

Which leaves me a bit stuck. Any help appreciated.

Hi cryptobadger,

the error message from ipfs-copy is not the most informative, IMHO. You can ask for help:
ipfs-copy --help

This should help also:

Let us know how you go.

Warm regards,
Chris | Infura | ConsenSys

Hi Chris,

That’s the very guide I was following when I encountered the error. Unfortunately ‘ipfs-copy --help’ returns ‘zsh: command not found: ipfs-copy’, presumably since installation isn’t complete.

G’day cryptobadger,

I believe I used:
go get -u github.com/INFURA/ipfs-copy
to install. But the second error you get says you don’t have go installed so that might not be the way.

it’s probably a good idea to install go anyway, I used:
brew install go

However I tested downloading and unzipping a release from github and it runs fine on a machine without go installed. Though you’d need to tell the mac it’s ok to run an unsigned app, etc. Come to think of it, install go and use go get.

Let us know how you go. Not a pun.

Warm regards,
Chris | Infura | ConsenSys

1 Like

Thanks Chris - definitely making progress!

First I had to install go using the ARM M1 chip specific command ‘arch -x86_64 brew install go’

and then installation of ipfs-copy was via ‘go install github.com/INFURA/ipfs-copy@latest’ (‘go get’ has been depreciated) but I received the message ‘package github.com/INFURA/ipfs-copy is not a main package’.

Curiously, I was then able to run the clone, copy and ‘make install’ method which appeared successful:

export GO111MODULE=on
env CGO_ENABLED=0 go install -ldflags="-s -w" ./cmd/ipfs-copy/
go: downloading github.com/coreos/go-semver v0.3.0
go: downloading github.com/gravitational/configure v0.0.0-20180808141939-c3428bd84c23
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: downloading github.com/gravitational/trace v1.1.14
go: downloading github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15
go: downloading github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: downloading github.com/jonboulle/clockwork v0.2.2
go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
go: downloading github.com/sirupsen/logrus v1.8.1

But then attempting to verify with ‘ipfs-copy version’ returned zsh: command not found: ipfs-copy

Tried installing go on a Windows machine and running “go install [github.com/INFURA/ipfs-copy@latest](http://github.com/INFURA/ipfs-copy@latest)”, with the same “package [github.com/INFURA/ipfs-copy](http://github.com/INFURA/ipfs-copy) is not a main package” result

Looks like it worked, despite the feedback. I had a bit of trouble checking the version to verify as I didn’t realise I had multiple ipfs-copy folders and was navigating to the one in my user root folder, rather than the one under go/bin. Heading there and typing ‘./ipfs-copy version’ returns the version number.
Now I just need to figure out the source API URL for Pinata!

Too many copies of ipfs-copy. Excellent news, thanks for letting us know.

1 Like