Go-eval Installation Error: "Command Not Found"
Encounters with the "command not found" error after installing go-eval are a common issue that arises when attempting to execute the go-eval command interactively. This error typically indicates that the go-eval executable is not available in the user's PATH environment variable.
To address this issue, it is necessary to add the GOPATH/bin directory to the PATH variable. The GOPATH/bin directory is where the go-eval executable is installed.
Solution:
PATH="$GOPATH/bin:$PATH"
This command will add the GOPATH/bin directory to the PATH variable.
Update for Go 1.8 and Above:
In Go 1.8 and above, the default value of GOPATH is $HOME/go. The solution provided above using GOPATH/bin will not work if GOPATH is not explicitly set.
To set both GOPATH and PATH, add the following lines to your .profile file:
export GOPATH="$HOME/go" PATH="$GOPATH/bin:$PATH"
Once these changes are made, reload your .profile file by running the following command:
source ~/.profile
Now, the go-eval command should be accessible by running "go-eval" in the terminal.
The above is the detailed content of Why Do I Get a 'Command Not Found' Error After Installing go-eval?. For more information, please follow other related articles on the PHP Chinese website!