Change default global installation directory for node.js modules in Windows?

Everything you need is in the npm-folders documentation. I don’t want to start my Win notebook now so I cannot verify it, but you should only change prefix to C:\Program Files\nodejs in your config file. If you want to change it globally for all users, edit the C:\Program Files\nodejs\npmrc file, otherwise create/edit C:\Users\{username}\.npmrc.

But this change will probably have some side effects, so read this discussion first. I don’t think it’s a good idea.

Leave a Comment