[readme] Add documentation for LTS updates which reinstall existing packages

Added an example for LTS updates that also reinstall the existing packages.
This is useful for individuals who run the latest LTS version along with global packages and need to update when the LTS version gets bumped
Saikat Das 2020-07-28 19:31:30 +05:30 committed by Jordan Harband
parent 424aeb38b4
commit 18c6f98acc
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 6 additions and 0 deletions

View File

@ -290,6 +290,12 @@ Node has a [schedule](https://github.com/nodejs/Release#release-schedule) for lo
Any time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported. Any time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported.
To get the latest LTS version of node and migrate your existing installed packages, use
```sh
nvm install --lts --reinstall-packages-from=current
```
### Migrating Global Packages While Installing ### Migrating Global Packages While Installing
If you want to install a new version of Node.js and migrate npm packages from a previous version: If you want to install a new version of Node.js and migrate npm packages from a previous version: