
Npm config -global set cache "C:\ProgramData\nodejs\npm-cache" Npm config -global set prefix "C:\ProgramData\nodejs" Set NODE_PATH environment variable as C:\ProgramData\nodejs\node_modules.Įnsure %NODE% environment variable previously created above is added (or its path) is added to %PATH% environment variable.Įdit %NODE_PATH%\npm\npmrc with the following content prefix=C:\ProgramData\nodejsįrom command prompt, set the global config like so.

Set NODE environment variable as C:\ProgramData\nodejs. Then create a folder called npm-cache at the root of the installation directory, which after following above would be C:\ProgramData\nodejs\npm-cache.Ĭreate a folder called etc at the root of the installation directory, which after following above would be C:\ProgramData\nodejs\etc.
#Nodejs path install
This can be done with chocolatey as: choco install nodejs.install -ia "'INSTALLDIR=C:\ProgramData\nodejs'"
#Nodejs path windows
setx PATH "%PATH% C:\Users\YOURNAME\AppData\Local\npm"īuilding on the installation concept of chocolatey and the idea suggested by what worked for me was to do the following and all users on windows were then happy working with nodejs and npm.Ĭhoose C:\ProgramData\nodejs as installation directory for nodejs and install nodejs with any user that is a member of the administrator group.Add the new npm path to your environment's PATH.npm config set cache "C:\Users\YOURNAME\AppData\Local\npm-cache".npm config set prefix "C:\Users\YOURNAME\AppData\Local\npm".C:\Users\YOURNAME\AppData\Local\npm\node_modules - globally installed modules will go here.C:\Users\YOURNAME\AppData\Local\npm - binary scripts for installed modules will go here.C:\Users\YOURNAME\AppData\Local\npm-cache - npm modules will go here.If you want to change your user's "global" location to %LOCALAPPDATA%\(npm|npm-cache) path instead: Add C:\ProgramData\npm to your System's Path environment variable.npm config -global set cache "C:\ProgramData\npm-cache".npm config -global set prefix "C:\ProgramData\npm".Set global configuration settings (Administrator Command Prompt).C:\ProgramData\npm\node_modules - globally installed modules will go here.


You can see my answer to this in my answer to another question.
