Skip to content

Commit 6262b5a

Browse files
chrismeyersljharb
authored andcommitted
[readme] rearrange install args
1 parent 925cff2 commit 6262b5a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,32 +356,32 @@ Any time your local copy of `nvm` connects to https://nodejs.org, it will re-cre
356356
To get the latest LTS version of node and migrate your existing installed packages, use
357357

358358
```sh
359-
nvm install 'lts/*' --reinstall-packages-from=current
359+
nvm install --reinstall-packages-from=current 'lts/*'
360360
```
361361

362362
### Migrating Global Packages While Installing
363363

364364
If you want to install a new version of Node.js and migrate npm packages from a previous version:
365365

366366
```sh
367-
nvm install node --reinstall-packages-from=node
367+
nvm install --reinstall-packages-from=node node
368368
```
369369

370370
This will first use "nvm version node" to identify the current version you're migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs "nvm reinstall-packages" to reinstall the npm packages from your prior version of Node to the new one.
371371

372372
You can also install and migrate npm packages from specific versions of Node like this:
373373

374374
```sh
375-
nvm install 6 --reinstall-packages-from=5
376-
nvm install v4.2 --reinstall-packages-from=iojs
375+
nvm install --reinstall-packages-from=5 6
376+
nvm install --reinstall-packages-from=iojs v4.2
377377
```
378378

379379
Note that reinstalling packages _explicitly does not update the npm version_ — this is to ensure that npm isn't accidentally upgraded to a broken version for the new node version.
380380

381381
To update npm at the same time add the `--latest-npm` flag, like this:
382382

383383
```sh
384-
nvm install 'lts/*' --reinstall-packages-from=default --latest-npm
384+
nvm install --reinstall-packages-from=default --latest-npm 'lts/*'
385385
```
386386

387387
or, you can at any time run the following command to get the latest supported npm version on the current node version:
@@ -415,7 +415,7 @@ nvm install iojs
415415
If you want to install a new version of io.js and migrate npm packages from a previous version:
416416

417417
```sh
418-
nvm install iojs --reinstall-packages-from=iojs
418+
nvm install --reinstall-packages-from=iojs iojs
419419
```
420420

421421
The same guidelines mentioned for migrating npm packages in node are applicable to io.js.

0 commit comments

Comments
 (0)