Yadr - oh my zsh - command not found - path

My system was installed by a friend and I have very low knowledge about linux system since I'm most used to Windows. I am on a Yosemite mac. My node was installed by brew install node, I have npm installed and from jslint install I get this error:
zsh: correct jslint to slit [nyae]? n
zsh: command not found: jslint
The fix seems to be from this website, a directory to PATH must be added.
export PATH="/usr/local/share/npm/bin:${PATH}"
I have low knowledge about the location of that file. Can I get where to find it or some introductory explanation?
Running echo $PATH; I get:
/usr/local/mysql/bin:/usr/local/share/npm/bin:/Users/frontend/.rvm/gems/ruby-2.1.3/bin:/Users/frontend/.rvm/gems/ruby-2.1.3#global/bin:/Users/frontend/.rvm/rubies/ruby-2.1.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/frontend/.rvm/bin:/Users/frontend/.yadr/bin:/Users/frontend/.yadr/bin/yadr

From web this is the source that gave me a hint how to fix it.
ls -a
vi .bash_profile
Add export PATH="$HOME/.node/bin:$PATH"
Then install again npm install -g jslint

Related

Finding the binary's name after package installation

When I installed 7zip via home brew (Formula sevenzip), i noticed that i cannot run it via sevenzip and even brew info sevenzip did not tell me the name of the binary.
Only after looking in the script file on Github I noticed a command 7zz but there must be an easier way to find out the binaries or commands associated with a homebrew package.
The simplest I know is:
brew ls PACKAGE
and you can normally see it pretty quickly. Personally, I use p7zip as PACKAGE.
Alternatively, as brew --prefix tells you where binaries are installed (via symlinks), you can find the newest installed binary with:
ls -lrt $(brew --prefix)/bin
and it's the last one listed.

homebrew with M1 macbook air error when starting terminals

I installed homebrew 3.0.0 on my M1 MBA.
However, every session including iterm2 terminal and tmux shows this error message:
/Users/jinrae/.zprofile:1: no such file or directory: opt/homebrew/bin/brew
In my case, it does not harm functionality at least in my usage pattern.
Anyhow, how can I get rid of this message?
I got this error because I installed brew on the Rosetta version of terminal to install packages, that are not yet M1 compatible.
To get rid of this message i opened my .zprofile with nano .zprofile.
The first line was
eval "$(/opt/homebrew/bin/brew shellenv)"
And i simply put a # before this line to comment it out and the message was gone.
To #sedavidw, /opt/homebrew/bin contains .keepme without contents:
/Users/jinrae/.zprofile:1: no such file or directory: opt/homebrew/bin/brew
➜ bin pwd
/opt/homebrew/bin
➜ bin la
total 0
-rw-r--r-- 1 jinrae admin 0B Feb 9 11:04 .keepme
EDIT: I read an article saying that homebrew is installed in /opt/homebrew/bin in M1 Mac whereas it is installed in /usr/local in Intel Mac. I'm trying to reinstall homebrew for M1 Mac now.
EDIT2: I solved the problem. It was due to for what homebrew is installed. As I heard, homebrew is installed in /usr/local for Intel Mac and /opt/homebrew/bin for M1 Mac.
I reinstalled homebrew with
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/nrubin29/bea5aa83e8dfa91370fe83b62dad6dfa/raw/48f48f7fef21abb308e129a80b3214c2538fc611/homebrew_m1.sh)"
which is slightly different from that in the official site (at least to me).
Anyhow, newly installed homebrew is located in /opt/homebrew/bin and the problem has been solved.
If you are using an Intel Mac, as mentioned above, Homebrew gets installed on /usr/local. Therefore, modify your .zprofile file (located in users/<username>) to use the correct path. Here is content of .zprofile:
eval "$(/usr/local/Homebrew/bin/brew shellenv)"
I have the M1 Mac and it was installed in /opt/homebrew/...
I opened /Users/~username~/.zprofile and it had two lines.
First line was:
eval "$opt/homebrew/bin/brew shellenv"
Second like was:
eval "$(/opt/homebrew/bin/brew shellenv)"
I just commented out the first line which doesn't actually have the </opt/> in the address. It's asking for a $opt, and then the address. So commenting out that line removed the location error and just read the correct line. So it doesn't show the error anymore when opening the terminal.
To Fix Type
nano .zprofile
then delete all of the stuff
then do ⌃X
then press return

Not able to install homebrew on my m1 macbook

I am trying to install homebrew on m1 MacBook but I am getting this error message every time when I try to run this command.
Please anyone help me to fix this.
How to install HomeBrew on new MacBook: macOS Big Sur
install HomeBrew from terminal Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installation, we need to change path
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!
To change path, follow Next steps: - Add Homebrew to your PATH in /Users/username/.zprofile As mentioned in terminal:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/username/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
All done ready to use brew, check HomeBrew version:
brew --version
Output
Homebrew 3.1.5
Homebrew/homebrew-core (git revision 5741ae3fec; last commit 2021-05-08)
Ok, I managed to figure this out after being pointed in the right direction. Full details can be found here: https://github.com/Homebrew/homebrew-cask/issues/100633
In summary, my ISPs (Virgin Media) Web Safe Settings were on, and this resulted in some issue with connecting to github (ping GitHub.com via terminal and search the IP to see where its pointing to), so had to turn off the web settings, rebooted my router just in case and used a new terminal window to ping github.com again and noticed a change in the IP address. Tried reinstalling Homebrew again and it worked!!
in my case, i fix the problem open the terminal as rosseta.
finder - application - utility - terminal - right mouse button - 'bring the imformation (i'm not sure, i'm korean user)' - check the 'open with the rosseta' - and try install homebrew again ! !
(copy-paste Homebrew with the terminal)
and...
==> Installation successful!
But, you will get a warning " /opt/homebrew/bin is not in your PATH". Then, follow the Next steps guide showed in terminal to finish add Homebrew to your PATH.
To end, type "brew -v" to check installed brew version.

Brew install nvm. nvm: command not found

After installing nvm with brew, and running nvm, it says nvm: command not found
How can I get the command to execute?
There are two steps to installing nvm with brew.
First use brew to install the application:
brew install nvm
Then take a look at the brew info "caveats" section, to see what else you have to do:
brew info nvm
You might see something like (this can change!):
You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
Add the following to ~/.bash_profile or your desired shell
configuration file:
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
If you do not have a ~/.bash_profile file, then you can simply create one.
Make sure to restart your terminal before trying to run the nvm command again.
I followed #user3207874's answer, but it still wasn't working for me. I had to run this command after those steps:
source $(brew --prefix nvm)/nvm.sh
From the docs:
Your system may not have a [.bash_profile file] where the command is
set up. Simply create one with touch ~/.bash_profile and run the
install script again
you might need to restart your terminal instance. Try opening a new
tab/window in your terminal and retry.
Restarting worked for me...Why can't all bugs be so easy?!!
Just adding some explanation for Aaditya's answer to explain why it works. I can't replay because I don't have enough reputation.
Basically there are 2 important steps to follow
Export NVM_DIR location. You need to create this folder if it doesn't exist first.
export NVM_DIR="$HOME/.nvm"
Second you need to source nvm's script. It is usually like this
. "/usr/local/opt/nvm/nvm.sh"
If the path on the second step does work it may be because the path is different in your device. One easy way to find its path is with the command
brew --prefix nvm
The output will be the path for the nvm installation directory in which the nvm.sh file resides. Setting the command inside $() will create a subshell to get that path. We can use it to source the nvm.sh script wherever it is located like this:
. $(brew --prefix nvm)/nvm.sh
Using that command is a replacement for . "/usr/local/opt/nvm/nvm.sh" in your .bash_profile.
please run this command
source ~/.nvm/nvm.sh
I had the same problem after running npm install
The following solution worked for me:
Run brew doctor to find broken symlinks for NPM
Run brew cleanup to clean them up
Just adding some new info.
The docs for nvm have this note:
Homebrew installation is not supported. If you have issues with homebrew-installed nvm, please brew uninstall it, and install it using the instructions below, before filing an issue.
So for anyone coming here, potentially uninstall via brew and install as per recommendation : https://github.com/nvm-sh/nvm

Problems installing iOS PonyDebugger

I am trying to install PonyDebugger. I am typing into the terminal the commands
curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \
python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
and installing the script and the files with success.
However, when I type ponyd serve --listen-interface=127.0.0.1, i receive from the terminal -bash: ponyd: command not found.
Any solutions on how to move from this step? I already installed XCode command line tools.
One of the PonyDebugger developers here. Try adding /usr/local/bin to your PATH.
An alternative is to run ponyd directly from the installation path.
~/Library/PonyDebugger/bin/ponyd serve --listen-interface=127.0.0.1

Resources