'Error: ipfs configuration file already exists

I already install ipfs via go ipfs. and I don't know why I encounter an error when I want to run "ipfs init " in my Terminal. could anyone help me to figure out where is the problem? here is an image of my Terminal:

enter image description here



Solution 1:[1]

The default ipfs repository path is ~/.ipfs Perhaps you can try to change your default path by:

export IPFS_PATH=/path/to/ipfsrepo

And then run ipfs init

Also, have you by any change installed go-ipfs from snap?

Solution 2:[2]

if you have not make any directory for IPFS using

ipfs init

will automatically generate node in your base directory Users/Username

if you wan to change the directory you can create one and then change the path using this command in terminal according to you created directory

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

for example i created ipfs-repo for my ipfs node so i have to run

export IPFS_PATH=/Users/jonah/ipfs-repo

happy coding!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Younas