Update "nvm use" to also alter npm's "prefix" configuration value #663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My project makes use of libraries that have what I like to call "special C bits" -- specifically "zmq" and "mongodb" -- which require compilation per version of node. In order to test one module that depends on zmq with multiple node / iojs versions, you'd have to either recompile the zmq library each time you ran the "nvm use" command, OR write a script to install certain libraries (like zmq) in separate, version specific global npm prefix directories.
The changes in this pull request would simply run the "npm config set prefix" command to change npm's "prefix" variable to be something other than the default of /usr or /usr/local
If it's the case that this is too special casey, please let me know, and consider adding a flag to the "nvm use" command. I'd much rather work from the mainline than my fork.
Also, I did read the CONTRIBUTING page, but I'm not 100% sure on the most appropriate way to test it. What's required at a minimum is that
npm config get prefix
command.Is it OK i.e best practice to install two arbitrary versions and switch between them? Should I go the extra mile to install versions that aren't installed and remove them afterwards?
Thanks in advance.