lukechilds / zsh-nvm

Zsh plugin for installing, updating and loading nvm
MIT License
2.24k stars 113 forks source link

Issue with nvm upgrade #42

Closed raisedadead closed 6 years ago

raisedadead commented 6 years ago

Hi,

I have been getting this error.

~/DEV
❯ nvm upgrade
Installed version is v0.33.8-4-g9273f23
Checking latest version of nvm...
Updating to v0.33.8...
error: pathspec '?]6;1;bg;red;brightness;157??]6;1;bg;green;brightness;194??]6;1;bg;blue;brightness;159?v0.33.8' did not match any file(s) known to git.
_zsh_nvm_upgrade:18: command not found: ^[]6;1;bg;red;brightness;157^G^[]6;1;bg;green;brightness;194^G^[]6;1;bg;blue;brightness;159^G

~/DEV
❯

My config is:

export NVM_LAZY_LOAD=true
zplug "lukechilds/zsh-nvm"
zplug "lukechilds/zsh-better-npm-completion", defer:2
lukechilds commented 6 years ago

How did you originally install nvm?

raisedadead commented 6 years ago

Thanks for getting back, well I originally installed just using the install script here

https://github.com/creationix/nvm#install-script

Had been using it for a while, when I discovered this repo, and added the config following the zplug instructions in the README.

Everything else works seamlessly. Except the upgrade command is broken with the output in the OP.

Note, since then I have also tried the below:

rm -rf ~/.nvm and relaunch a new zsh session in hopes of self installing the nvm as the README says.

Here is the result:

Installing nvm...

~
❯ which nvm
nvm not found

~
❯ tree ~/.nvm
/Users/raisedadead/.nvm
└── alias
    └── lts

2 directories, 0 files

~
❯

Currently I am back to as I were before using this plugin. That is, I have installed nvm from creationix's script.

Do you want me to try out anything else that will help understand the issue better?

raisedadead commented 6 years ago

Okay, I think I found the problem.

Not sure, if this is a candidate for documentation, but I also had the completion scripts

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

sourced in my ~/.zshrc after the zplug config

Removing it, and doing a clean install that is:

rm -rf ~/.nvm

And relaunching a new zsh session, bam! Everything works.

Sorry about missing this in the first place. Thanks for the awesome tool.