You may run pacman -Syu every day, but when did you last refresh every Node major you keep in nvm?
I added update-nvm.sh for that. It updates each installed major to the latest patch, refreshes global npm packages, upgrades npm via --latest-npm, and runs corepack enable. If a major is already on the latest patch, Node is left alone but global packages are still refreshed. Pass --force to reinstall Node anyway, or --npm-only to skip Node installs entirely.
Install
| |
Common usage
| |
Cron (weekly LTS refresh, quiet, prune old patches):
0 3 * * 0 ~/.local/bin/update-nvm -q --lts --prune
When installing a major that is not installed yet, the script asks whether to copy global npm packages from another major. Press Enter for a fresh install (default), or pick a source major. For non-interactive installs, set NVM_REINSTALL_FROM=24.
Run update-nvm --help for the full option list. Source: static/scripts/update-nvm.sh.
Thoughts on this note? I'd love to hear them on these platforms: