-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvm error after adding lines to .bashrc #1725
Comments
What is |
It's a bash framework. It doesn't matter if it's commented or not I still get the same error. I have removed everything and added things back to my bash script one a a time and doing a source ~/.bashrc after each one. There is nothing in my bash script that is causing the error except the 2 NVM lines. If I leave the first one and remove the other 2 the error goes away. I'm very meticulous about how I do things and asking for help here is a last resort. I've tried everything I can think of to fix this to no avail. |
Is your home dir, or The issue here is because nvm is a sourced shell function, so it could conflict with literally any other line in your bash sourcing path, such that commenting out the "source nvm" line would work, but also commenting out "the conflicting line" would work - we only have to find it :-) Once we do, I can see if there's a way for nvm to work around it. |
@ljharb what do you think about adding a issue label like |
Sorry so long to respond. I've been on vacation. Anyway I figured out why it was causing the error. In my ~/.bash_aliases I had an alias - alias="tr=tree" and that was causing the error. I renamed it and everything works fine now. @ljharb thank you for all of your help. |
okay, I know how to fix it now, something like what I guess, PR #1735 sent now, with that fix, you should be able to keep your personal aliases :) |
Operating system and version: Arch Linux 4.14.3-1-hardened
nvm debug
output:nvm ls
output:How did you install
nvm
? (e.g. install script in readme, homebrew):Install script using cURL
What steps did you perform?
Cloned the repository then added the source lines to .bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion
What happened? It worked but now every time I open a new terminal or source ~/.bashrc it outputs three lines before the bash prompt, they are as follows:
-bash: [: : integer expression expected
-bash: [: too many arguments
-bash: [: too many arguments
What did you expect to happen? I expected my bash prompt to be unchanged.
Is there anything in any of your profile files (
.bashrc
,.bash_profile
,.zshrc
, etc) that modifies thePATH
? Yes, here is a copy of my .bashrc file:The text was updated successfully, but these errors were encountered: