It can happen that npm install -g <package-name> reports an EPERM error. This means that npm isn't allowed to write to the directory without administrator rights. To fix this npm needs to be configured so that it uses a different folder.
npm config set prefix "%AppData%/npm"