Closed ghost closed 3 years ago
Thank you! Maybe a dupe of #154?
Did it work fine when you tried your suggestion?
Ho Jorge! Oh, yes, sorry, see per log above. Created the directory and it ran smoothly. I guess it's related to #154.
Something like that often happens when testing in a non-reproducible environment. I pesonally use a wrapper for any expected dependency (set target (__dir blah)
) which returns 1 on permissions error or 0 and the path of the created or existing folder if all is well as an inline substiture for directory variables. Or testing in a docker container, but I try to make sure all external dependencies are more ot less controlled (but bloats the codebase unless you have a DSL for that :-) To summarize: #154 and #161 (this) should both be reproducible in a more or less clean arch (ar at least manjaro) install. Let me know if I can be of further assistance in pinning this down!
I think we can do as you suggest. If you would like to send me a PR, you can do that, otherwise, I'll try to look into it soon(ish).
i can confirm the bug with a newly install OS
If anyone can send me a PR for this, I'll look into it right away.
@jorgebucaran i'm looking forward opening a PR to address this issue, was studying the code and stumbled upon this, i know that it might sound like a dumb question, but even though it's not actually working, in theory, shouldn't it be able fix this? it's recursively creating the ~/.local/share/nvm/$v
, or am i missing something?
My thoughts, exactly. I haven't been able to reproduce this myself.
@qodo-io @tuananh Thoughts?
This happened to me while running a fresh install of Arch on a vm, creating the directory solved the issue, but this got me thinking, it's a bit confusing taking into consideration that in theory it should work, but in practice it doesn't, not sure if it affects all use cases, or only some specific ones
Did you install nvm.fish using Fisher?
Yep, i strictly followed the instructions on the readme
i try many distro in the past weeks and this all happens on a freshly installed OS. install using fisher + instructions in nvm.fish readme.
Does it happen on macOS too?
Does it happen on macOS too?
can't say. I no longer use macOS
@qodo-io I was able to reproduce this by deliberately removing $nvm_data
, and trying to use nvm install
.
That will cause nvm to fail, but you shouldn't be missing $nvm_data
as it's created on install: https://github.com/jorgebucaran/nvm.fish/blob/8922519b432140e6eaafbb4dc397505c8da80139/conf.d/nvm.fish#L6
Maybe this happened because you were using an ancient nvm before we had lifecycle events, and got into a situation where you didn't have $nvm_data
but nvm installed.
@tuananh $nvm_data
must exist after installing nvm
. If it doesn't, then your Fish could be broken.
Thanks for this thread, I just ran into this on Arch, been a loooong time since I used nvm/node on this box. But... I had the AUR nvm
installed as well as jorgebucaran/nvm.fish
installed with Fisher. I removed the nvm
AUR package and then still had to fisher remove jorgebucaran/nvm.fish
and then fisher install jorgebucaran/nvm.fish
again to get nvm list-remotes
to work without throwing this error in the OP.
Thanks!
Hey Jorge
Love nvm.fish, just ran into minor trouble when doing a fresh install on manjaro arch 21.1, fish etc. is up to date.
maybe do a
set -l d $HOME/.local/share/nvm; test -d $d; or mkdir -p $d 2>/dev/null
on install to make sure ...?Thanks!