Was having a issue installing a NodeJS npm package. On a Digital-Ocean Droplet Ubuntu (14.04) server.
npm
npm install -g PACKAGE-NAME
For me, I didn't want to install npm for all the users. Hence wasn't using sudo npm .... Instead I granted the required permissions to the directory and it worked.
sudo npm ...
sudo chmod -R ugo+rw ./node_modules/