Home » Nodejs » NVM global module folder

NVM global module folder

Posted by: admin November 29, 2017 Leave a comment


I am using NVM and I am trying to install global NPM modules. That action requires permissions to a folder that I don’t have permissions to. With regular node.js/npm that was easy to solve with prefix configuration but NVM explicitly forbids it.

What is the right way to change the path to global modules folder in NVM?


To see the location of the current version of node you are using:

nvm which current

You are using the system installation if .nvm is not in the path, similar to the following:


To switch to a version managed by nvm:

nvm use 4

To verify you are using a version managed by nvm:

nvm which current

You should see something similar to the following:


You should only experience global install permission issues when you are using the system installation.


Inside ~/.npmrc:


Or you can use $PREFIX shell environment:

export PREFIX="${HOME}/.local"