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"
Either use Windows' control panel to do this or the following script which changes the PATH
for the current user (No admin rights required).
node windows-add-to-path.js
Hint: Don't use the setx
command. It has a 1024 characters limit.
Log out and back in from your Windows user account.
If you have a github account, you should leave a comment and report back (Also if everything worked).
How would I do this on Mac?