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

nvm is not compatible with the npm config "prefix" option when /home is a symlink #2302

Closed
jeffrson opened this issue Sep 13, 2020 · 2 comments

Comments

@jeffrson
Copy link

jeffrson commented Sep 13, 2020

nvm worked for me, until I needed to move /home to another partition and set /home a symlink to the new location.

I think there is not much need for any details. The cause is probably node's behaviour with symlinks. So you may have to rethink about the prefix behaviour in such case.

Following the error message node cannot be used at all:

$ nvm install 14.10.1
v14.10.1 is already installed.
nvm is not compatible with the npm config "prefix" option: currently set to "/data/home/user/.nvm/versions/node/v14.10.1"
Run `nvm use --delete-prefix v14.10.1` to unset it.
Creating default alias: default -> 14.10.1 (-> v14.10.1)
$ node -v
-bash: node: Command not found

/home is a symlink to /data/home.

@ljharb
Copy link
Member

ljharb commented Sep 13, 2020

Indeed, this is a duplicate of #617. nvm doesn't support your home dir or nvm dir being a symlink.

Could you hard link /home instead of symlinking it? That would likely cause a lot fewer problems with various tools.

@jeffrson
Copy link
Author

Oops, sorry - haven't found this existing report, when searching for "prefix" messages.

No, directories cannot be hard linked. I put /home back and symlinked another larger directory. So nvm works again, but unfortunately this is not quite a solution.

Closing anyway in favor of the older issue.

Thanks!

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

2 participants