Skip to content
Myr

[Docs] document `nvm reinstall-packages` as a standalone command

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The standalone `nvm reinstall-packages <version>` command can migrate global npm packages between already-installed versions, but it was only mentioned in `nvm --help`, not in the README. Add a section covering it. Refs #3858

authored by Jordan Harband · committed by Jordan Harband · parent a6ec739 · Browse files · 1 file+12 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−0 removed

  • other:+12 added−0 removed

1 file+12 added−0 removed

modified:README.md+12 added
29 unmodified lines
30 - [Manual Upgrade](#manual-upgrade)31- [Usage](#usage)32 - [Long-term Support](#long-term-support)33 - [Migrating Global Packages While Installing](#migrating-global-packages-while-installing)34 - [Migrating Global Packages Between Installed Versions](#migrating-global-packages-between-installed-versions)35 - [Offline Install](#offline-install)36 - [Default Global Packages From File While Installing](#default-global-packages-from-file-while-installing)37 - [io.js](#iojs)38 - [System Version of Node](#system-version-of-node)
444 unmodified lines
483```484485If you've already gotten an error to the effect of "npm does not support Node.js", you'll need to (1) revert to a previous node version (`nvm ls` & `nvm use <your latest _working_ version from the ls>`), (2) delete the newly created node version (`nvm uninstall <your _broken_ version of node from the ls>`), then (3) rerun your `nvm install` with the `--latest-npm` flag.486487### Migrating Global Packages Between Installed Versions488489`--reinstall-packages-from` is tied to `nvm install`. To migrate global npm packages between versions you _already_ have installed, without (re)installing anything, `nvm use` the destination and run `nvm reinstall-packages` as a standalone command, pointing at the version you want to copy _from_:490491```sh492nvm use 22.22.2493nvm reinstall-packages 22.20.0494```495496This reinstalls all global packages from `22.20.0` into the currently-active version (`22.22.2`). As with `--reinstall-packages-from`, the npm version itself is not changed.497498499### Offline Install500501If you've previously downloaded a node version (or it's still in the cache), you can install it without any network access using the `--offline` flag:502
705 unmodified lines