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
fnm current version reset on sleep / lock / stale terminal #624
Comments
To be clear, I am not quite sure if it only happens when on sleep / lock. It may also have happened randomly in terminal sessions, that I haven't used for some time. Can this happen at all? |
Ok, seems like it is not related to sleep / lock only. I did not use the terminal for a while, since I was debugging something and then tried to commit something and husky could not find node in that terminal. There is something cleaned up underneath for sure after some time. |
If I try to run fnm use afterwards, this error is thrown
|
Seems like your test directory is being deleted every couple of minutes. What OS are you using? |
the following PR should fix the |
I guess it's MacOS 😅 |
Then maybe you’re low on storage? 😳 |
No I have 500GB space left ... |
I am on latest macos running iterm2 and zsh. This issue did not ever happen before with fnm, just started after i updated to the latest fnm version. I was on 1.28.x before... |
I will try the fix for now thank you |
The last release did not fix this issue @Schniz. Do you have any idea to investigate more what is happening? Is there any way for me to install a 1.28.x version on mac and test if it is still happening? Did you introduce any changes since then, that could have caused this issue? |
Let's try: you can download any release from the releases page. Download the version that matches your OS and arch, and The release shouldn't have been fixed it, just make the cryptic error disappear. The issue is temp directory being cleaned when the computer sleeps which never happened to me |
@Schniz It is happening without sleep. I noticed it happens randomly all the time. I have no clue what is happening. I first thought it's when I open a new terminal or vscode but it is not reproducable. :( |
@Schniz Since I am using 1.28.2 it works. There is no problem anymore. It has to do something with the recent changes about recursive strategy I guess .... |
this is very weird. again, never had these problems. based on #624 (comment) what I believe is that it fails in Line 96 in 5755aae
and since the error is We can test it though, if you use 1.29.2 :) like:
I don't find anything weird in the changes between 1.28.2 and 1.29.1 🤔 |
@Schniz fyi this is the output in a working directory
|
Can you investigate it a bit? Seems like the symlink is broken? Can you |
I'm using the latest now and cannot reproduce anymore since I restarted my mac yesterday. This is sooo weird. Hopefully it is magically resolved now. Will keep you updated. Thanks :) |
😱 thank you! |
Unfortunately it started happening again.
I did a small break for 20 minutes and when I came back to my desk, node was no longer available.
The default alias is still present though
|
@Schniz Is there a way to change / configure the paths for the symlinks? |
@ulco, It's undocumented, but you could set mkdir -p $HOME/.tmp
. <(TMPDIR=$HOME/.tmp fnm env) and the result is: ~ $ echo $FNM_MULTISHELL_PATH
/home/[edited]/.tmp/fnm_multishells/973909_1641984228694 |
Thanks @alexeyten. I think what I did add after it worked for some time is the flag with recursive again. I had deleted it in the meantime to try out if it was the issue and I think it is causing it. I don't have a |
I am removing the |
FYI, removing the flag did not solve it! |
Changing $TMPDIR like @alexeyten suggested works so far. |
Happy to announce that I am now running Monterey 12.1 and it happens to me too 😭 |
Probably you should not use TMP for this. |
I found some info about Also /tmp is periodically cleaned up by /etc/periodic/{daily,monthyl,weekly} which is maybe better? but it has drwxrwxrwt The local standard cache dir is ~/Library/Caches for macos |
Since I installed the latest fnm to try the new recursive version strategy I have the following problem:
When I lock my mac and put it into sleep for some time, my current shell sessions (including vscode) cannot find node & npx anymore. I think the symlink is getting cleaned up or something? When I open up a new terminal fnm is working properly again. But the current shell does not have any current node version. fnm current outputs none.
My setup is as simple as the following as first line in
.zshrc
:The text was updated successfully, but these errors were encountered: