Trying to install using the install script
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
Output:
→ [Desktop] curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12540 100 12540 0 0 52980 0 --:--:-- --:--:-- --:--:-- 53135
=> Downloading nvm from git to '/Users//.nvm'
=> mkdir: /Users//.nvm: Permission denied
ls: /Users//.nvm: No such file or directory
fatal: could not create work tree dir '/Users//.nvm': Permission denied
Failed to clone nvm repo. Please report this!
→ [Desktop]
$ echo $HOME returns /Users/myname
This is a fresh macOS installation.
what do echo whoami and echo $HOME print out?
$ echo whoami returns whoami 😉
but $ whoami returns myname properly.
Original post contains $ echo $HOME result, /Users/myname
oh lol sorry, thanks.
It's important what the exact value of "myname" is tho - since /Users//.nvm is what's showing up in the install script.
Separately, do you have an NVM_DIR env var set, or any mention of nvm in any of your profile files?
I do have NVM_DIR set 🤔
export NVM_DIR="/Users/${whoami}/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
The issue looks to be ${whoami}. Should be $(whomai) or just $HOME
All is well now! Thank you.
ha, yep that'd do it. :-)
Most helpful comment
Separately, do you have an
NVM_DIRenv var set, or any mention of nvm in any of your profile files?