I installed Homebrew today, and as the application suggested, I ran
brew doctor
I got this warning:
Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
/Users/MyUsername/
After googling this, I opened
vi ~/.bash_profile
from terminal and manually removed the "/" after my username. So now my .bash_profile looks like this:
export PATH=$PATH:/Users/MyUsername
export PATH=/usr/local/git/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/MyUsername
Then I retyped the prompt and got the same warning. How do I fix this?
Did you try restarting Terminal? Or at least opening a new session (tab)?
And if you're using zsh, you'll need to edit the ~/.zshrc file and remove the trailing slash on the end of "/usr/local/bin" as well.
After editing your profile, you have to tell the OS. From the terminal, execute the following command:
source ~/.bash_profile
Related
Every time I open my terminal the first line says: -bash: /nvm.sh: No such file or directory.
I just installed nvm on this laptop and obviously I did something wrong.
Does anyone know what commands I can use to fix this?
I tried the following command to remove nvm from my laptop:
$ rm -rf ~/.nvm
Sadly, this did not fix my problem.
Check your .bashrc file (usually in the home folder). See answers to this question. There's probably a line reading /nvm.sh somewhere in there -- if so, just delete it.
As Gasper Stukelj awnsered:
There was a line reading /nvm.sh.
The correct path to the file was for me using macOS Mojave:
$ open ~/.bash_profile
In my case I fixed this problem, just putting in terminal, after installing nvm: export NVM_DIR="$HOME/.nvm" and [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
and after that I installed node normally
How did I find this solution?
Simple, I read the terminal, and it gave two ways to solve. The first option was for me to restart the computer, to see if the changes (installation) took effect, and the second option was for me to put these two commands in the terminal and only : )
Ready to use in my case :)
I used Google Translate
For me the issue was coming from the .bash_profile file. The line was:
source ~/.nvm/nvm.shexport PATH="/usr/local/opt/php#7.0/bin:$PATH"
I removed everything after nvm.she and the error isn't showing in the terminal anymore. This happened while trying to install xdebug on Mac Big Sur.
I failed to find a solution in Google searches, so I just installed nvm again to resolve the issue. I guess some files were not installed.
brew install nvm
Whenever I open a terminal, the following errors pop out instantly:
bash: /usr/share/bash-compl: No such file or directory
bash: etion/bash_completion: No such file or directory
Also, when I try to compile my ~/.bashrc I get the same errors.
What should I do?
P.S. (I'm using Ubuntu 16.04 LTS)
There was a newline in ~/.bashrc which caused the breaks in those lines. Removing it fixed the issue.
Following steps worked for me:
Go to /etc/skel and do ls -a.
Locate .bashrc.
Copy that or open it with any editor and copy it to the home .bashrc file.
I'm working in Windows 10 with a fresh installation of Anaconda and Git Bash. I decided to set cmd.exe as my default console program to use git bash (instead of the minTTY), and I think already I am getting issues with Unix style characters vs Windows.
When I fire up cmd Bash tells me it can't find my conda.sh file:
bash: C:UsersjoshuAnaconda3/etc/profile.d/conda.sh: No such file or directory
First, it looks like bash is missing the default windows slashes for my root directory ("C:/Users/joshu/"). Does anyone know how to fix this?
Thanks
I have the exact same problem. Run ~/.bashrc in a terminal. Go to the path given and correct the conda.sh path.
In your case, you will replace the C:\Users\joshu\Anaconda3/etc/profile.d/conda.sh to C:/Users/joshu/Anaconda3/etc/profile.d/conda.sh
Your only problem is that your slashes are set wrong.
Fix this issue by opening ~/.bashrc and change location of conda.sh, e.g. in my case
. D:/Users/my_user/ProgramFile/Continuum/anaconda3/etc/profile.d/conda.sh
Had the same problem on Windows 10/Git Bash/Anaconda installation. If you run ~/.bashrc in Git Bash, it should give you the location of the shell script file containing the incorrect path. Once you correct the path in that file, the message should disappear when you restart the terminal.
Another thing to check is make sure your user profile folder under C:\Users has not gone hidden. If it has gone hidden, then the C:\Anaconda\etc\profile.d\conda.sh script
won't be able to find the folder.
I tried to change something in my bash_profile but I think I mistyped something. So I can not run any terminal commands. If I post "ls" command then I get
-bash: ls: command not found
Now I can not open bash_profile also. So what can I do here. I get the below path using echo command but there was some any other path. Please help.
echo $PATH: /usr/local/bin:/usr/local/bin:
But if I write /bin/ls it works.
MacBook Pro El Capitan : 10.11.4
This is the possible answer - And I solved it using nano editor
You messed up your PATH environment variable.
/bin/ls
works because you did not need PATH to find the 'ls' program. You can run ANY command by specifying its full path.
You need to re-edit your .bash_profile to either remove your PATH, or fix it. I do not know what editor you used to modify .bash_profile to begin with, but you can use
/usr/bin/nano
/usr/bin/vi (ONLY if you know vi/Vim)
/usr/bin/vim (ONLY if you know vi/Vim)
/usr/bin/emacs (I shutter to think about this)
TextWrangler (a very good free GUI text editor)
http://www.barebones.com/products/textwrangler/
Or you can just rename the current .bash_profile and start a new terminal session, then fix the renamed .bash_profile before putting it back in service
/bin/mv .bash_profile saved.bash_profile
I have followed the following approach in order to install Torch in my machine (Mac).
http://torch.ch/docs/getting-started.html#_
When I am done with the installation, I type:
$ luarocks install image
or $ luarocks lis
or $th
in order to load the th or to make updates on the lua packages. It says "command not found". Do you have any idea how I can resolve this issue?
If you're on a Mac using the bash terminal, make sure that you've permanently added /Users/you/torch/install/bin to your PATH.
To do this:
Navigate in your terminal to the root directory by running the command:
$ cd
Using the text editor of your choice (emacs, vim, etc.) open the .bash_profile file for editing. For example:
$ emacs .bash_profile
Add the following line to the end of the file (replacing 'you' with your Mac username):
PATH=$PATH\:/Users/you/torch/install/bin ; export PATH
Save and exit the text editor
Source the changes by running:
$ source .bash_profile
Check that your PATH has been updated (look for /Users/you/torch/install/bin in the string returned):
$ echo $PATH
To make sure it has been changed permanently, completely quit Terminal, open it and run echo $PATH again
Now try th and it should run Torch!
For more help on PATH:
https://kb.iu.edu/d/acar
The Torch installation (at least for me) added the line . /Users/jb/torch/install/bin/torch-activate to my .profile file, not .bash_profile. I tried adding that exact line to .bash_profile but it didn't work, so based on the recommendations here I got rid of the trailing directory and such.
Have you updated your PATH? It should include something like
/home/user/torch/install/bin
I faced the same issue and following this post deleted and reinstalled everything. However in the end what helped was adding /home/user/torch/install/bin/ to the PATH variable.
I have resolved the issue. I have deleted torch and I have installed it again. I have updated my PATH, and I have ran the $ luarocks install image command. After all of these, I was able to ran $ th command and in general torch.