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

Error: Can't create the symlink for multishells #938

Open
rielcfb opened this issue Mar 11, 2023 · 7 comments
Open

Error: Can't create the symlink for multishells #938

rielcfb opened this issue Mar 11, 2023 · 7 comments

Comments

@rielcfb
Copy link

rielcfb commented Mar 11, 2023

CENTOS 7

  • sudo user

just installed fnm using:

$ curl -fsSL https://fnm.vercel.app/install | bash
Checking dependencies for the installation script...
Checking availability of curl... OK!
Checking availability of unzip... OK!
Downloading https://github.com/Schniz/fnm/releases/latest/download/fnm-linux.zip...
######################################################################## 100.0%
Installing for Bash. Appending the following to /home/user/.bashrc:

  # fnm
  export PATH="/home/user/.local/share/fnm:$PATH"
  eval "`fnm env`"

In order to apply the changes, open a new terminal or run the following command:

  source /home/user/.bashrc

then running command:

$ source ~/.bashrc
error: Can\'t create the symlink for multishells at "/run/user/0/fnm_multishells/9715_1678542462996". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)

also errors when runnng command fnm env

$ fnm env 
error: Can\'t create the symlink for multishells at "/run/user/0/fnm_multishells/9715_1678542462996". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)
@far-rainbow
Copy link

the same
error: Can't create the symlink for multishells at "/run/user/0/fnm_multishells/83501_1678795858761". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)
unsafe easy solution: chmod 777 /run/user/0
you can use other mod rules to allow only user you want acces to "user 0" (root) dir but how to install fnm wthout all these hacks? thanks

@lackovic
Copy link

lackovic commented Aug 7, 2023

After installing fnm, every time I open a shell I get the following error:

error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/2354_1691420468557". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)

The error happens on the execution of

eval "`fnm env`"

which was added to my .bashrc with the fnm installation.

Also, neither npm nor node are recognized as commands:

$ fnm install v18.17.0
Installing Node v18.17.0 (x64)
warning: Version already installed at "/home/marco/.local/share/fnm/node-versions/v18.17.0"

$ npm
Command 'npm' not found, but can be installed with:
sudo apt install npm

$ node
Command 'node' not found, but can be installed with:
sudo apt install nodejs

As workaround I changed the owner of that directory with:

sudo chown -R $(whoami) /run/user/1000/

System info:

$ lsb_release -d
Description:    Ubuntu 22.04.3 LTS

@jnunderwood
Copy link

I am also getting this error, though I am trying to run fnm 1.35.1 on Ubuntu 22.04.3 LTS from WSL (Windows Subsystem for Linux). This just started happening recently, within the past month. In my case, however, the directory /run/user/1000 does not exist.

Perhaps fnm could try creating this directory, with the proper ownership and permissions, before trying to write to it? Not sure if that is a feasible option or not. Thanks!

@geekish
Copy link

geekish commented Dec 23, 2023

Also running into this issue, exact same setup as @jnunderwood. Worked just fine yesterday, booted up this morning after a Windows update and got the error.

@jnunderwood
Copy link

jnunderwood commented Feb 15, 2024

I believe I found a solution. Just set the environment variable XDG_RUNTIME_DIR to a location such as $HOME/.cache/xdgr. I added this line to my .zshrc:

export XDG_RUNTIME_DIR="$HOME/.cache/xdgr"

Now fnm will use this directory instead of /run/user/1000 for multishell support. This seems to be working for me. I'll add a new comment if this changes.

@lackovic
Copy link

export XDG_RUNTIME_DIR="$HOME/.cache/xdgr"

I added this line to my .bashrc but I am still getting the same error every time I open a new terminal:

error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/7064_1708262245393". Maybe there are some issues with permissions for the directory? No such file or directory (os error 2)

Since the directory $HOME/.cache/xdgr didn't exist I tried to create it but that didn't change anything.

My previous workaround doesn't work anymore, when I run:

sudo chown -R $(whoami) /run/user/1000/

now I get the error:

chown: cannot access '/run/user/1000/': No such file or directory

After I create the directory with:

sudo mkdir /run/user/1000

then I am able to apply the workaround with chown.

This works only temporarily, after some time for some reason the directory /run/user/1000 gets deleted I have to repeat running both the mkdir and the chown commands to make fnm work.

@jnunderwood
Copy link

Hi @lackovic. I was experiencing the same situation, until I made my change (above).

The only thing I can think of is that the export line in your .bashrc file must come before the fnm line, like this:

# fnm - fast node manager
export XDG_RUNTIME_DIR="$HOME/.cache/xdgr"
eval "$(fnm env --use-on-cd)"

Hopefully that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants