I\'ve been trying to run an npm install on my package.json file, but I\'m having a lot of trouble. It keeps saying \"Error: Attempt to unlock XXX, which hasn\'t been locke
In my case the issue was invoking npm with a user that does not have a HOME directory, so for example the following command would fail:
sudo -u someUser npm install
The solution is to provide a HOME directory, where someUser has write access:
someUser
sudo -u someUser HOME=/some/directory npm install