Skip to content
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

Doesn't work on fresh install #1853

Closed
ghost opened this issue Jun 29, 2018 · 16 comments
Closed

Doesn't work on fresh install #1853

ghost opened this issue Jun 29, 2018 · 16 comments
Labels
installing nvm Problems installing nvm itself needs followup We need some info or action from whoever filed this issue/PR. shell: zsh: oh-my-zsh

Comments

@ghost
Copy link

ghost commented Jun 29, 2018

I get the following error as soon as I source my ~/.zshrc

/home/taxborn/.nvm/nvm.sh:2038: parse error near `)'

I believe I have done everything right, and in the screen shot you can see that I have just installed it. Here is the line(s) in question.

  if ! (
    # shellcheck disable=SC2086
    command mkdir -p "${TMPDIR}" && \
    command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \
    VERSION_PATH="$(nvm_version_path "${PREFIXED_VERSION}")" && \
    nvm_cd "${TMPDIR}" && \
    nvm_echo '$>'./configure --prefix="${VERSION_PATH}" $ADDITIONAL_PARAMETERS'<' && \
    ./configure --prefix="${VERSION_PATH}" $ADDITIONAL_PARAMETERS && \
    $make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} && \
    command rm -f "${VERSION_PATH}" 2>/dev/null && \
    $make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} install
  ); then # <--- This is line 2038
    nvm_err "nvm: install ${VERSION} failed!"
    command rm -rf "${TMPDIR-}"
    return 1
  fi

screenshot from 2018-06-29 17-13-18

Thank you!

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

You'll note how the install script adds nvm lines to bashrc; but you're then using zshrc.

Does nvm work fine in bash? What's your zshrc look like?

@ljharb ljharb added needs followup We need some info or action from whoever filed this issue/PR. installing nvm Problems installing nvm itself labels Jun 30, 2018
@ghost
Copy link
Author

ghost commented Jun 30, 2018

It works fine in bash, and I have it added in my .zshrc.

Here are the lines of code added:

#NVM
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

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

I'm very confused :-/ the line in question hasn't changed in a long time, and if there was a syntax error, every zsh user would have been complaining for awhile now.

Can you share the rest of your zshrc, as well as the output of setopt?

@ghost
Copy link
Author

ghost commented Jun 30, 2018

setopt:

alwaystoend
autocd
autopushd
completeinword
extendedhistory
noflowcontrol
histexpiredupsfirst
histignoredups
histignorespace
histverify
incappendhistory
interactive
interactivecomments
longlistjobs
monitor
promptsubst
pushdignoredups
pushdminus
sharehistory
shinstdin
zle

.zshrc

Yeah, this worked before, I used NVM for about a year and this only has happened in the past few weeks..

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

One thing that would be helpful is (assuming you're on v0.33.11 now) downgrading to v0.33.10, and seeing if the problem still occurs?

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

My stock zsh has:

combiningchars
interactive
monitor
nonomatch
shinstdin
zle

which means that the delta is:

alwaystoend
autocd
autopushd
completeinword
extendedhistory
noflowcontrol
histexpiredupsfirst
histignoredups
histignorespace
histverify
incappendhistory
interactivecomments
longlistjobs
promptsubst
pushdignoredups
pushdminus
sharehistory

If you try a binary search on those options - disabling half, try again, re-enable and disable the other half, etc - that also would help determine the fix.

@ghost
Copy link
Author

ghost commented Jun 30, 2018

Hmm, same error, same line.. I can go into bash and install the node version I want, but still in ZSH it still seems to be the same error in v0.33.10 running the command:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.10/install.sh | bash

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

Thanks - if you're willing, we could also try going back farther - v0.33.0, v0.32.0 - trying to pin down which version it stopped working for you.

@ghost
Copy link
Author

ghost commented Jun 30, 2018

Alright, I tried v0.32.0 Still get the same parse error, but different line

/home/taxborn/.nvm/nvm.sh:1867: parse error near `)'

Is it worth mentioning I use Oh My Zsh too?

@ghost
Copy link
Author

ghost commented Jun 30, 2018

Also in v0.31.0, line 1428. This is pretty damn confusing

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

(yes, it was worth mentioning, but i inferred it from your zshrc - omz tends to break nvm all the time because it sets a bunch of nonstandard options)

Let's keep jumping back versions - v0.15.0 if needed :-) I'll need two things to fix it - the version where it broke (so i can find the commit that broke it) and then likely the zsh option that's causing it to be parsed differently.

@ghost
Copy link
Author

ghost commented Jun 30, 2018

I have some good news, v0.15.0 works without error! I'll go ahead and try to pinpoint the version. (somewhere between v0.31.0 and v0.15.0). Could you explain to me how I could find the ZSH option that could be impacting it?

@ghost
Copy link
Author

ghost commented Jun 30, 2018

Sweet, it works in v0.26.1 but not in v0.27.0. So somewhere in there something broke, at least for my setopt settings..

@ljharb
Copy link
Member

ljharb commented Jun 30, 2018

Thanks, that's the first step :-) v0.26.1...v0.27.0 has a bunch of things.

For the options, you can use unsetopt alwaystoend etc, to unset the options (before sourcing nvm.sh) and see which one makes it fail.

@ghost
Copy link
Author

ghost commented Jul 1, 2018

Alright, after trying to binary-search my way through the setopt and unsetopt process, nothing came out of it. Still the same parse error 😦

@ljharb
Copy link
Member

ljharb commented May 4, 2019

Since nobody else has reported this, and the user has deleted their github account, I'm going to close this.

Happy to reopen if there's a way to repro.

@ljharb ljharb closed this as completed May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm Problems installing nvm itself needs followup We need some info or action from whoever filed this issue/PR. shell: zsh: oh-my-zsh
Projects
None yet
Development

No branches or pull requests

1 participant