Skip to content

nvm use: produce warning if local database is stale #3745

@fulldecent

Description

@fulldecent

Operating system and version:

nvm debug output:

Details
Last login: Tue Dec  9 11:43:04 on ttys031

~
❯ nvm debug
nvm --version: v0.40.3
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'williamentriken'
${HOME}: /Users/williamentriken
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.gem/ruby/3.1.0/bin:${HOME}/.gem/ruby/3.1.0/bin:${HOME}/.gem/ruby/3.1.0/bin:${HOME}/.rd/bin:${HOME}/.gem/ruby/3.1.3/bin:${HOME}/.rubies/ruby-3.1.3/lib/ruby/gems/3.1.0/bin:${HOME}/.rubies/ruby-3.1.3/bin:${NVM_DIR}/versions/node/v24.11.1/bin:${HOME}/.rbenv/shims:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Applications/Little Snitch.app/Contents/Components:/opt/homebrew/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (arm64-apple-darwin25.0)'
uname -a: 'Darwin 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 arm64'
checksum binary: 'sha256sum'
OS version: macOS 26.1 25B78
awk: /usr/bin/awk, awk version 20200816
curl: /usr/bin/curl, curl 8.7.1 (x86_64-apple-darwin25.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.67.1
wget: /opt/homebrew/bin/wget, GNU Wget 1.25.0 built on darwin24.1.0.
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/bin/git, git version 2.50.1 (Apple Git-155)
ls: grep:: No such file or directory
grep: grep: aliased to grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}), grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
nvm current: v24.11.1
which node: ${NVM_DIR}/versions/node/v24.11.1/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v24.11.1/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v24.11.1
npm root -g: ${NVM_DIR}/versions/node/v24.11.1/lib/node_modules

~

nvm ls output:

Details
nvm ls
       v22.20.0
->     v24.11.1
         system
default -> lts/* (-> v24.11.1)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v24.11.1) (default)
stable -> 24.11 (-> v24.11.1) (default)
lts/* -> lts/krypton (-> v24.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.8 (-> N/A)
lts/iron -> v20.19.6 (-> N/A)
lts/jod -> v22.21.1 (-> N/A)
lts/krypton -> v24.11.1

How did you install nvm?

What steps did you perform?

  1. Wake up in 2024
  2. nvm use (.nvmrc has lts/*, it installs node 22)
  3. Sleep under a rock for a year
  4. nvm use

What happened?

Still using node 22.

What did you expect to happen?

(This should only happen if you are resolving a non-absolute version number and if you have not updated the local database in 30+ days.)

ℹ️  Your nvm version database has not been updated in 30+ days. To update it, run:
nvm xxxxxxx

Discussion

lts/* should automatically know and get the latest major versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions