I originally posted this in /r/bash but it isn't getting much traction. I know this isn't strictly a node issue, and likely the error is on my system, but I'm getting a bit desperate at this point. Hope I'm not a bother here! Also, since posting I've updated to macOS 10.13.6 (most recent).I'm trying to install nvm via their official install steps. However I'm running into an issue when running the nvm shell script. I'm getting the following error:-bash: /Users/lulzbaby/.nvm/nvm.sh: line 278: syntax error near unexpected token `done' -bash: /Users/lulzbaby/.nvm/nvm.sh: line 278: ` done' This seems to be an issue with bash and not the nvm install itself. I'm basing that primarily off Issue #1553 where a user experiences something similar. However, I already have UTF-8 set in both my Terminal and iTerm2 profiles.I've tried the install script on their GH page, the git install, the manual install, and even this homebrew install method. All encounter the same error. Here is the code around line 278:nvm_tree_contains_path() { 14 local tree 13 tree="${1-}" 12 local node_path 11 node_path="${2-}" 10 9 if [ "@${tree}@" = "@@" ] || [ "@${node_path}@" = "@@" ]; then 8 nvm_err "both the tree and the node path are required" 7 return 2 6 fi 5 4 local pathdir 3 pathdir=$(dirname "${node_path}") 2 while [ "${pathdir}" != "" ] && [ "${pathdir}" != "." ] && [ "${pathdir}" != "/" ] && [ "${pathdir}" != "${tree}" ]; do 1 pathdir=$(dirname "${pathdir}") 278 done 1 [ "${pathdir}" = "${tree}" ] 2 } As you can see it is a fairly straight-forward while loop and the syntax seems fine. I've even run cat -v nvm.sh to make sure there are no funny characters running around in there, but nothing.This has sunk about 2 hours of my day and I have no clue what is going on. Help me /r/bash / /r/node, you are my only hope!
Submitted September 01, 2018 at 04:35PM by LulzBaby
No comments:
Post a Comment