nvm: nvm.sh:114: parse error near `done'

Last week, I randomly started getting the following message when I open a new terminal window:

~/.nvm/nvm.sh:114: parse error near `done'

I tried uninstalling and reinstalling nvm with the following commands:

$ rm -rf ~/.nvm
# remove the nvm load script from my zshell config
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash

but I’m still getting the message. Here are the relevant lines (110-114) from nvm.sh:

local pathdir
pathdir=$(dirname "$node_path")
while [ "$pathdir" != "" ] && [ "$pathdir" != "." ] && [ "$pathdir" != "/" ] && [ "$pathdir" != "$tree" ]; do
  pathdir=$(dirname "$pathdir")
done

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 28 (6 by maintainers)

Most upvoted comments

omg. i found it. I had set up an alias to connect to my digital ocean server:

alias do=ssh root@xxx.xxx.xxx.xxx

can’t believe it didn’t hit me that do is a reserved word. Everything’s working now. Thanks for all your help! I think you’ve taught me the skills to troubleshoot this on my own next time. cheers.

In 2020, I had a similar issue with alias done='send notification to my machine' Thank you for opening this issue 😹

@stevehanson this was EXACTLY my issue.

omg. i found it. I had set up an alias to connect to my digital ocean server:

alias do=ssh root@xxx.xxx.xxx.xxx

can’t believe it didn’t hit me that do is a reserved word. Everything’s working now. Thanks for all your help! I think you’ve taught me the skills to troubleshoot this on my own next time. cheers.

Holy hell I had done the same thing…

alias do='docker'

Haha thanks for saving me more pain than needed.

holy crap how many of us made the same digitalocean alias 😂

Another one 😃 This time it is not Digital Ocean but a todo list in terminal… Thought it was a good idea to create “do” alias 😵‍💫 Thanks for the help 😃

I’ll add my name to the list of shame. Thanks for sharing!

omg. i found it. I had set up an alias to connect to my digital ocean server:

alias do=ssh root@xxx.xxx.xxx.xxx

can’t believe it didn’t hit me that do is a reserved word. Everything’s working now. Thanks for all your help! I think you’ve taught me the skills to troubleshoot this on my own next time. cheers.

Just had this issue today and it’s the exact same alias screwing it up. LMFAO