If HOME environment variable is set on Windows, it is overwritten
If the user sets the HOME environment variable on Windows, importing npm-conf causes the environment variable to be changed to the user profile directory. This occurs because os.homedir() always returns the Windows-defined home directory (%USERPROFILE%, typically C:\Users\username); it does not consider the HOME environment variable (which is reasonable, as HOME is not significant to the Windows OS). But HOME is significant to many cross-platform applications, and modifying it can cause processes that are invoked after importing npm-conf to behave wrongly.
https://github.com/kevva/npm-conf/blob/master/lib/defaults.js#L21
I'd suggest that npm-conf check if process.env.HOME is defined, and only set it to os.homedir() if it is not defined. This would respect the user override if there is one, while ensuring that HOME is sanely defined if the user didn't set it explicitly.
I can send a PR for this if you'd like!
cc @kevva This has caused https://github.com/Azure/get-proxy-settings to break git