-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
sed error on Ubuntu 14.04 server #493
Comments
Which version of |
Hi, I'm using the latest version I guess, I just deleted and reinstalled today a few hours ago.
After some commenting out and trials I found this version "works" (no warranty). nvm_format_version() {
// echo "$1" | sed -e 's/^\([0-9]\)/v\1/g'
echo "$1" | sed -e 's/^\([0-9]\)/v\\1/g'
} Note the escaped Hope that helps and is not messing other things up. |
By doing that, it turns the backreference To get this error, are you typing any If when sourcing, could you paste the relevant lines in your |
Just when I'm sourcing. I can't even get the My .bash_profile ends with: export NVM_DIR="/home/kematzy/.nvm"
# source $NVM_DIR/nvm.sh
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
I also tried the commented out line: ie: What is the AFAIU, it's used in handling the output from the So when I test this on my local OS X machine and on my hacked VPS I get two different results even though I've got almost the same Node versions installed. On non-hacked OS X install: $ nvm ls
v0.10.24
v0.10.28
v0.10.29
v0.10.30
v0.11.7
v0.11.9
current: v0.10.29
default -> v0.10.29
$ nvm ls v0.1
N/A
$ nvm ls v0.10
N/A
$ nvm ls v0.11
N/A
$ nvm ls v0.10.2
v0.10.2
$ nvm ls v0.10.29
v0.10.29 On hacked VPS install: $ nvm ls
-> v0.10.29
v0.10.30
v0.11.9
system
default -> v0.10.29
$ nvm ls v0.11
v0.11.9
$ nvm ls v0.10
-> v0.10.29
v0.10.30
$ nvm ls v0.10.2
N/A
$ nvm ls v0.10.29
-> v0.10.29
Which one is outputting things correctly? |
You shouldn't need to specify the "v" - |
@kematzy Can you try this again on the latest |
I've got the same problem on OSX
leads to
nvm version 0.22.0 |
@ivan-kleshnin What's your |
Would this work across shells or is this specific to bash? Sorry, saw this thread and thought I'd throw something out there. nvm_format_version() {
echo ${1/#[0-9]/v${1:0:1}}
} |
@drkibitz I believe that syntax is not bash-specific, but not portable. It errors out in |
No |
@ivan-kleshnin thanks - a few more :-) |
Thank you, Jordan, I've nailed it down with your help. It was line |
Ah, yes - aliasing builtin commands can always cause trouble. That said, I can fix this particular one, and hopefully it will fix @kematzy's issue as well. |
So it's better to always give aliased builtins new names, to avoid similar problems in future, right? |
@ivan-kleshnin yes, exactly. |
I'm unable to use nvm on Ubuntu server 14.04 VPS as I'm getting this error in the console when login or source ~/.bash_profile.
sed: -e expression #1, char 18: invalid reference \1 on
s' command's RHS`Something is wrong in the ~/.nvm/nvm.sh file relating to the sed commands, but which one is sadly beyond my skills.
Any chance of assisting in this matter?
The text was updated successfully, but these errors were encountered: