I'm not 100% sure, but I believe I installed node v5 from the windows installer on both my home and office PCs.
On my home PC global installs happen under %APPDATA%:
(dev) go|c:\srv> which lessc
c:\users\bjorn\appdata\roaming\npm\lessc
c:\users\bjorn\appdata\roaming\npm\lessc.cmd
while on my office PC, they go under program files:
(dev) go|w:\srv> which lessc
c:\program files\nodejs\lessc
c:\program files\nodejs\lessc.cmd
I need to provide the full path to a number of these global tools to PyCharm's file watcher, and since the project file i shared it would make sense to not have global resources under a user folder.
Why would the global installs end up in different folders, and how can I force them to a location that is common to all team members?
According to: https://docs.npmjs.com/files/folders
The docs might be a little outdated, but they explain why global installs can end up in different directories:
Based on the other answers, it may seem like the override is now the default location on Windows, and that I may have installed my office version prior to this override being implemented.
This also suggests a solution for getting all team members to have globals stored in the same absolute path relative to their PC, i.e. (run as Administrator):
open a new cmd.exe window and reinstall all global packages.
Explanation (by lineno.):
setx .. /M
to set the system path (under HKEY_LOCAL_MACHINE). This is what requires you to run this in a shell with administrator permissions.npm
to use this new path. (Note: folder isn't visible in %PATH% in this shell, so you must open a new window).Just press windows button and type %APPDATA% and type enter.
Above is the location where you can find \npm\node_modules folder. This is where global modules sit in your system.
These are typical npm paths if you install a package globally: