Nvm: Result of cURL installation command: You have $NVM_DIR set to "/home/.../.nvm", but that directory does not exist.

Created on 22 Jul 2018  Â·  3Comments  Â·  Source: nvm-sh/nvm

  • Operating system and version: Kubuntu 18.04

  • nvm debug output:

`zsh: command not found: nvm`

  • nvm ls output:
`zsh: command not found: nvm`

  • How did you install nvm? (e.g. install script in readme, Homebrew): curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

  • What steps did you perform?

I entered the above command in my terminal.

  • What happened?

It seemed like nvm finished downloading, and then I got the error:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12819  100 12819    0     0  27567      0 --:--:-- --:--:-- --:--:-- 27508
You have $NVM_DIR set to "/home/.../.nvm", but that directory does not exist. Check your profile files and environment.
  • What did you expect to happen?

I expected nvm to correctly install, and I expected to be able to use the nvm command.

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?

My .zshrc contains the following PATH modification for the EB CLI:

# elastic beanstalk command line interface
export PATH=~/.local/bin:$PATH

  • If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?
*   Trying 2400:cb00:2048:1::6814:162e...
* TCP_NODELAY set
* Connected to nodejs.org (2400:cb00:2048:1::6814:162e) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.nodejs.org
*  start date: Aug 14 00:00:00 2017 GMT
*  expire date: Nov 20 23:59:59 2019 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55c1506b38e0)
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> User-Agent: curl/7.58.0
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200 
HTTP/2 200 
< date: Sun, 22 Jul 2018 07:53:06 GMT
date: Sun, 22 Jul 2018 07:53:06 GMT
< content-type: text/html
content-type: text/html
< set-cookie: __cfduid=ddfabbf81acab48f004ce1dff3082bb851532245985; expires=Mon, 22-Jul-19 07:53:05 GMT; path=/; domain=.nodejs.org; HttpOnly
set-cookie: __cfduid=ddfabbf81acab48f004ce1dff3082bb851532245985; expires=Mon, 22-Jul-19 07:53:05 GMT; path=/; domain=.nodejs.org; HttpOnly
< cf-cache-status: EXPIRED
cf-cache-status: EXPIRED
< vary: Accept-Encoding
vary: Accept-Encoding
< expires: Sun, 22 Jul 2018 11:53:06 GMT
expires: Sun, 22 Jul 2018 11:53:06 GMT
< cache-control: public, max-age=14400
cache-control: public, max-age=14400
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< server: cloudflare
server: cloudflare
< cf-ray: 43e454e2086a795b-SEA
cf-ray: 43e454e2086a795b-SEA
< content-encoding: gzip
content-encoding: gzip

< 
* Connection #0 to host nodejs.org left intact

Most helpful comment

Yes actually NVM_DIR was set already to ~/.nvm because my .zshrc is symlinked to my dotfiles.

Simply creating the empty ~/.nvm directory fixed installation!

This is interesting though because I did not have to create that directory when I set up my dotfiles on the latest Ubuntu. Maybe it was a glitch where my .zshrc was not properly symlinked yet, so NVM_DIR was not set.

All 3 comments

Do you have NVM_DIR set already? If so, can you try unsetting it and reinstalling?

Is your home dir a symlink or mounted from another drive?

Yes actually NVM_DIR was set already to ~/.nvm because my .zshrc is symlinked to my dotfiles.

Simply creating the empty ~/.nvm directory fixed installation!

This is interesting though because I did not have to create that directory when I set up my dotfiles on the latest Ubuntu. Maybe it was a glitch where my .zshrc was not properly symlinked yet, so NVM_DIR was not set.

It's also a relatively new change in nvm to error in this case.

Glad you figured it out!

Was this page helpful?
0 / 5 - 0 ratings