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

Confusing upper/lower case names using --lts when listing and installing (default -> N/A) #1781

Closed
jeff-kilbride opened this issue Apr 10, 2018 · 1 comment
Assignees
Labels
bugs Oh no, something's broken :-(

Comments

@jeff-kilbride
Copy link

  • Operating system and version:
    Ubuntu 16.04.4 LTS

  • nvm debug output:

# nvm debug
nvm --version: v0.33.8
$SHELL: /bin/bash
$HOME: /root
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)'
uname -a: 'Linux 4.4.0-1052-aws #61-Ubuntu SMP Mon Feb 12 23:05:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux'
OS version: Ubuntu 16.04.4 LTS
curl: /usr/bin/curl, curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
wget: /usr/bin/wget, GNU Wget 1.17.1 built on linux-gnu.
git: /usr/bin/git, git version 2.7.4
grep: /bin/grep (grep --color=auto), grep (GNU grep) 2.25
awk: /usr/bin/awk, GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)
sed: /bin/sed, sed (GNU sed) 4.2.2
cut: /usr/bin/cut, cut (GNU coreutils) 8.25
basename: /usr/bin/basename, basename (GNU coreutils) 8.25
rm: /bin/rm (rm -iv), rm (GNU coreutils) 8.25
mkdir: /bin/mkdir, mkdir (GNU coreutils) 8.25
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.7.0-git
nvm current: none
which node:
which iojs:
which npm:
npm config get prefix: The program 'npm' is currently not installed. You can install it by typing:
apt install npm
npm root -g: The program 'npm' is currently not installed. You can install it by typing:
apt install npm
  • nvm ls output:
# nvm ls
->      v8.11.1
default -> lts/carbon (-> v8.11.1)
node -> stable (-> v8.11.1) (default)
stable -> 8.11 (-> v8.11.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.1 (-> N/A)
lts/carbon -> v8.11.1
  • How did you install nvm? (e.g. install script in readme, Homebrew):
    Install script in README

  • What steps did you perform?
    See below.

  • What happened?
    See below.

  • What did you expect to happen?
    See below.

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

  • If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?
# curl -I --compressed -v https://nodejs.org/dist/
*   Trying 104.20.23.46...
* Connected to nodejs.org (104.20.23.46) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 594 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* 	 server certificate verification OK
* 	 server certificate status verification SKIPPED
* 	 common name: *.nodejs.org (matched)
* 	 server certificate expiration date OK
* 	 server certificate activation date OK
* 	 certificate public key: RSA
* 	 certificate version: #3
* 	 subject: OU=Domain Control Validated,OU=PositiveSSL Wildcard,CN=*.nodejs.org
* 	 start date: Mon, 14 Aug 2017 00:00:00 GMT
* 	 expire date: Wed, 20 Nov 2019 23:59:59 GMT
* 	 issuer: C=GB,ST=Greater Manchester,L=Salford,O=COMODO CA Limited,CN=COMODO RSA Domain Validation Secure Server CA
* 	 compression: NULL
* ALPN, server accepted to use http/1.1
> HEAD /dist/ HTTP/1.1
> Host: nodejs.org
> User-Agent: curl/7.47.0
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 10 Apr 2018 05:42:10 GMT
Date: Tue, 10 Apr 2018 05:42:10 GMT
< Content-Type: text/html
Content-Type: text/html
< Connection: keep-alive
Connection: keep-alive
< Set-Cookie: __cfduid=d3fdc8665844d7c2f8a15bfd537ac9ab11523338929; expires=Wed, 10-Apr-19 05:42:09 GMT; path=/; domain=.nodejs.org; HttpOnly
Set-Cookie: __cfduid=d3fdc8665844d7c2f8a15bfd537ac9ab11523338929; expires=Wed, 10-Apr-19 05:42:09 GMT; path=/; domain=.nodejs.org; HttpOnly
< CF-Cache-Status: EXPIRED
CF-Cache-Status: EXPIRED
< Vary: Accept-Encoding
Vary: Accept-Encoding
< Expires: Tue, 10 Apr 2018 09:42:10 GMT
Expires: Tue, 10 Apr 2018 09:42:10 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: 4092e377a9f12a4f-SEA
CF-RAY: 4092e377a9f12a4f-SEA
< Content-Encoding: gzip
Content-Encoding: gzip

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

Originally posted in #1651.

I've been using nvm for a couple of years, but I found this to be pretty confusing. I installed on a new system and decided to use the --lts flag to install node. I typically just install using a version number like v8.11.1. So, I ran nvm ls-remote --lts and it returned a list of available versions with the lts name capitalized, e.g. v8.11.1 (Latest LTS: Carbon). Naturally, I then ran:

nvm install --lts=Carbon --latest-npm

I logged out and then back into the shell and got the same type of error as the OP in #1651. Notice the output of nvm ls:

$ nvm ls
        v8.11.1
default -> lts/Carbon (-> N/A)
node -> stable (-> v8.11.1) (default)
stable -> 8.11 (-> v8.11.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.1 (-> N/A)
lts/carbon -> v8.11.1

The default is set to lts/Carbon, the name I used during installation, but the actual is lts/carbon. Just to test it, I deleted my .nvm directory and started over so I could capture the install message:

$ nvm install --lts=Carbon --latest-npm
Installing with latest version of LTS line: Carbon
Downloading and installing node v8.11.1...
Downloading https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v8.11.1 (npm v5.6.0)
! WARNING: Version 'lts/Carbon' does not exist.
Creating default alias: default -> lts/Carbon (-> N/A)
Attempting to upgrade to the latest working version of npm...
* Installing latest `npm`; if this does not work on your node version, please report a bug!
/home/nodebb/.nvm/versions/node/v8.11.1/bin/npm -> /home/nodebb/.nvm/versions/node/v8.11.1/lib/node_modules/npm/bin/npm-cli.js
/home/nodebb/.nvm/versions/node/v8.11.1/bin/npx -> /home/nodebb/.nvm/versions/node/v8.11.1/lib/node_modules/npm/bin/npx-cli.js
+ npm@5.8.0
added 89 packages, removed 42 packages and updated 67 packages in 9.076s
* npm upgraded to: v5.8.0

Sure enough, even though the installation completes, we get a warning:

! WARNING: Version 'lts/Carbon' does not exist.
Creating default alias: default -> lts/Carbon (-> N/A)

If the lowercase name is required for the default alias to be setup correctly, then the --lts= switch on install should either require lowercase or convert to lowercase automatically. It's confusing having ls-remote --lts return the names capitalized, while install requires lowercase.

@ljharb ljharb added the bugs Oh no, something's broken :-( label Apr 10, 2018
@ljharb
Copy link
Member

ljharb commented Apr 10, 2018

I think the best solution here is always lowercasing it; i guess i never anticipated someone doing the perfectly reasonable thing you did :-)

@ljharb ljharb self-assigned this Apr 10, 2018
@ljharb ljharb closed this as completed in 74ff70a Apr 10, 2018
wzrdtales pushed a commit to wzrdtales/nvm-ng that referenced this issue Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Oh no, something's broken :-(
Projects
None yet
Development

No branches or pull requests

3 participants
@ljharb @jeff-kilbride and others