HOME environment variable changes under npm on Windows

Hi all,
I’ve noticed a quirk when running npm scripts via Git Bash on Windows 10. Namely, the value of my HOME variable changes for commands called via npm, as opposed to direct from the shell:

$ env |grep ^HOME=
HOME=/h/

$ npm run env |grep ^HOME=
HOME=C:\Users\jake

This is creating some headaches, because in I’m running scripts which depend on Git and ssh configuration, which are expected to live under $HOME. Does anyone know why this occurs, and/or how to change it?

For now, I’m working around it by maintaining the configs under both HOME paths, but feel like it would be cleaner to use the same path for either context.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.