HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/.nvm/test/slow/nvm reinstall-packages/works with no installs
#!/bin/sh

die () { echo "$@" ; exit 1; }

\. ../../../nvm.sh

get_packages() {
  npm list -g --depth=0 | \sed -e '1 d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | xargs
}

nvm use 4.7.2
ORIGINAL_PACKAGES=$(get_packages)

nvm reinstall-packages 4.7.1
FINAL_PACKAGES=$(get_packages)

[ -z "${ORIGINAL_PACKAGES}" ] || die "original packages were not empty: ${ORIGINAL_PACKAGES}"
[ -z "${FINAL_PACKAGES}" ] || die "final packages were not empty: ${FINAL_PACKAGES}"