If you are currently visiting this article
-bash: xxxx: command not found
I think you've hit the error. And until now when such an error came out "Error-> Search-> Copy-> I'm not sure but solved" Isn't it like that? (I used to be ...)
From that state by looking at this article "Error-> Search-> Copy-> __Understanding __-> Resolve" or You can be in the state of "Error-> __ Think __-> Resolve". In other words, does PATH pass like this! You will understand that!
Let's learn how to PATH from my example.
I bought a MacBook Air today and wanted to install homebrew, so I was installing while looking at this site. Then on a screen like this
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Something is warning, but it's successful and is it okay! I thought, and when I execute the following command
MacBook-Air:~ username$ brew install
-bash: brew: command not found
Oh, there's no brew ...
PATH is also known as an environment variable. Yes, it's a variable! Speaking of variables in programming, they are used like "__ Let's replace the same thing with a certain word because it is troublesome to write it many times __". Similarly, omit PATH because it's a hassle to write the same thing over and over again! It exists like __.
Now, in order to run brew you need to know where brew is. When I searched for the above error, it was in /opt/homebrew/bin/.
MacBook-Air:bin username$ /opt/homebrew/bin/brew -v
I tried this and it worked!
I thought that the reason why brew -v couldn't be executed was apparently because the variables weren't set properly. After checking various things, it seems that the variables can be checked with the following code.
$echo $PATH
When I ran it, I got a lot of PATH.
-bash: /usr/local/bin:/usr/bin:/bin:/usr/sbin:・ ・ ・
This means
I referred to this article.
export PATH="$PATH:/opt/homebrew/bin/"
By inputting like this, you can give an instruction to add/opt/homebrew/bin/to the environment variable "__ $ __"!
https://qiita.com/zaburo/items/29fe23c1ceb6056109fd https://qiita.com/Naggi-Goishi/items/2c49ea50602ea80bf015
Recommended Posts