fnm
fnm copied to clipboard
error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/3628_1715158318789". Maybe there are some issues with permissions for the directory? No such file or directory (os error 2)
error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/3628_1715158318789". Maybe there are some issues with permissions for the directory? No such file or directory (os error 2)
I am using WSL2 Ubuntu, Fish shell and TMUX.
if status is-interactive
# Commands to run in interactive sessions can go here
if not set -q TMUX; and not set -q VSCODE_IPC_HOOK_CLI
exec tmux
end
if command -v starship > /dev/null
starship init fish | source
end
end
workaround:
sudo systemctl restart user@1000
Happens to me aswell. WSL2-tmux
Think this is due to missing userid folder and subfolders, fix is to create the missing folder heirachy and change ownership to user i.e.
sudo mkdir -p /run/user/<userid,default=1000>/fnm_multishells
sudo chown -R /run/user/<userid,default=1000>
Think this is due to missing userid folder and subfolders, fix is to create the missing folder heirachy and change ownership to user i.e.
sudo mkdir -p /run/user/<userid,default=1000>/fnm_multishells sudo chown -R /run/user/<userid,default=1000>
This works on my wsl2 ubuntu 24.04:
sudo mkdir -p /run/user/1000/fnm_multishells
sudo chown -R 1000 /run/user/1000/
I have a workaround.
The root cause is that /run/user/1000 isn't created after fnm launches for some reason.
Therefore, I changed the folder that fnm uses. I found that fnm respects XDG_RUNTIME_DIR when creating the fnm_multishells folder.
https://github.com/Schniz/fnm/blob/186e4bbd9204d7658a4f9923955281687a01e8c3/src/directories.rs#L71-L77
https://github.com/Schniz/fnm/blob/186e4bbd9204d7658a4f9923955281687a01e8c3/src/directories.rs#L16-L18
The following is my solution:
eval "$(XDG_RUNTIME_DIR=/tmp/run/user/$(id -u) fnm env --use-on-cd --shell zsh)"