Error: ipfs configuration file already exists

Error: ipfs configuration file already exists

我已经通过 go ipfs 安装了 ipfs。而且我不知道为什么当我想在我的终端中 运行 "ipfs init " 时遇到错误。 谁能帮我找出问题出在哪里? 这是我的终端的图像:

默认的 ipfs 存储库路径是 ~/.ipfs 也许您可以尝试通过以下方式更改默认路径:

export IPFS_PATH=/path/to/ipfsrepo

然后运行 ipfs init

此外,您是否通过任何更改从 snap 安装了 go-ipfs?

如果您还没有使用

为 IPFS 创建任何目录
ipfs init

会在你的基础目录下自动生成节点Users/Username

如果你想更改目录,你可以创建一个,然后根据你创建的目录在终端中使用此命令更改路径

export IPFS_PATH=/Users/<your system username>/<the name of directory you created>

例如,我为我的 ipfs 节点创建了 ipfs-repo,所以我必须 运行

export IPFS_PATH=/Users/jonah/ipfs-repo

编码愉快!