-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated readme file to include --reinstall-packages-from #795
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you also add nvm install node --reinstall-packages-from=node
, and perhaps change this line to nvm install v0.12.7 --reinstall-packages-from=0.12
to convey that the "from" version is read before installing the new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to make those changes. Could you give me just a little more info on what this does:
nvm install node --reinstall-packages-from=node
And on this nvm install v0.12.7 --reinstall-packages-from=0.12, do you mean to convey that the "from" is read before installing to verify that it exists or for some other reason? Asking so I can word it appropriately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - basically, it first says nvm version node
and resolves that to v0.12.6
in your example, then installs whatever node
resolves to on the remote (v0.12.7
in your example), and then runs nvm reinstall-packages v0.12.6
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to be clear, how would it know to resolve to v0.12.6 by using this syntax?
nvm install node --reinstall-packages-from=node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming 0.12.6
was the latest node version installed, node
is an alias for stable
which is an alias for "last even minor version of node" which resolves to 0.12.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this look:
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome. Probably should also add nvm install iojs --reinstall-packages-from=iojs
right below the node example, so that's covered too, but otherwise LGTM!
Thanks again!
Updated readme file to include --reinstall-packages-from
I wanted to add the syntax and example usage for the --reinstall-packages-from when migrating packages to a new Node install to the Readme file.