I created an alias file for holding alias
nano .bash_aliases
and then used the command
alias ganache='./ganachescript'
However,
$ ./ganachescript
08:29:17.571 › Checking for update
08:29:19.052 › Update for version 2.4.0 is not available (latest version: 2.4.0, downgrade is disallowed).
but if I write:
$ ganache
ganache: command not found
Somebody please guide me.
That's a quite not-correct way to set an alias. The command
./ganachescript
means 'execute the executable fileganachescript
that exists in the current directory'. So the alias would work only when you run theganache
command in the specific directory where theganachescript
file is located.To overcome this you need to use the full path to the
ganachescript
file instead as below