Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
adjust for symbolic links #2143
Currently the nvm.sh script does not handle directories that are symbolic links. This is a common problem on servers that use symbolic links to persistent drives. For example, an admin might want to install nvm into /opt/local/node, but the real location (without the symlinks) is /files2/opt-local/node/nvm. This results in:
Assuming the admin knows this issue and uses the real directory, there is no problem:
The small change I am providing will get the real directory to avoid the problem with symbolic links.
I don't know if cd -P is available on all Linux systems, but I have tested in MacOS, RedHat, AWS AMI and Debian.