From 3543cd5d2f1cf83e693db45b057a686c0b8b0e96 Mon Sep 17 00:00:00 2001 From: Rey Bango Date: Tue, 4 Aug 2015 15:19:38 -0400 Subject: [PATCH 1/3] Updated usage instructions to include --reinstall-packages-from syntax and example --- README.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.markdown b/README.markdown index d8d8a37..af4b882 100644 --- a/README.markdown +++ b/README.markdown @@ -76,6 +76,11 @@ In place of a version pointer like "0.10", you can use the special default alias nvm use stable nvm run unstable --version +If you want to install a new version of Node.js and migrate packages from a previous version: + + nvm install v0.10.40 --reinstall-packages-from=0.10.39 + nvm install v0.12.7 --reinstall-packages-from=0.12.6 + If you want to install [io.js](https://github.com/iojs/io.js/): nvm install iojs From b7a93be02e88c0020372b615dbc650c682df2531 Mon Sep 17 00:00:00 2001 From: Rey Bango Date: Tue, 4 Aug 2015 15:23:07 -0400 Subject: [PATCH 2/3] Updated to added npm to the text --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index af4b882..d36f9ec 100644 --- a/README.markdown +++ b/README.markdown @@ -76,7 +76,7 @@ In place of a version pointer like "0.10", you can use the special default alias nvm use stable nvm run unstable --version -If you want to install a new version of Node.js and migrate packages from a previous version: +If you want to install a new version of Node.js and migrate npm packages from a previous version: nvm install v0.10.40 --reinstall-packages-from=0.10.39 nvm install v0.12.7 --reinstall-packages-from=0.12.6 From d9662f138f713e7895babf743144764106494f55 Mon Sep 17 00:00:00 2001 From: Rey Bango Date: Tue, 4 Aug 2015 17:35:03 -0400 Subject: [PATCH 3/3] Updated based on feedback from @ljharb on syntax description and functionality --- README.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.markdown b/README.markdown index d36f9ec..f4efb2b 100644 --- a/README.markdown +++ b/README.markdown @@ -78,6 +78,12 @@ In place of a version pointer like "0.10", you can use the special default alias If you want to install a new version of Node.js and migrate npm packages from a previous version: + nvm install node --reinstall-packages-from=node + +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. + +You can also install and migrate npm packages from specific versions of Node like this: + nvm install v0.10.40 --reinstall-packages-from=0.10.39 nvm install v0.12.7 --reinstall-packages-from=0.12.6 @@ -85,6 +91,12 @@ If you want to install [io.js](https://github.com/iojs/io.js/): nvm install iojs +If you want to install a new version of io.js and migrate npm packages from a previous version: + + nvm install iojs --reinstall-packages-from=iojs + +The same guidelines mentioned for migrating npm packages in Node.js are applicable to io.js. + If you want to use the system-installed version of node, you can use the special default alias "system": nvm use system