Nvm: Install script is broken

Created on 6 Jan 2018  Â·  6Comments  Â·  Source: nvm-sh/nvm

  • Operating system and version: macOS Sierra, fresh install.

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.

Mac OS non-issue / invalid

Most helpful comment

Separately, do you have an NVM_DIR env var set, or any mention of nvm in any of your profile files?

All 6 comments

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. :-)

Was this page helpful?
0 / 5 - 0 ratings