After a fresh install of NodeJS and NPM on my machine I wanted to install Express but kept running into an error:
npm ERR! Error: EACCES, open ‘/Users/devakone/.npm/64a534c1-express.lock’
npm ERR! { [Error: EACCES, open ‘/Users/devakone/.npm/64a534c1-express.lock’]
npm ERR! errno: 3,
npm ERR! code: ‘EACCES’,
npm ERR! path: ‘/Users/devakone/.npm/64a534c1-express.lock’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
It seems the error is a permissions issue as the .npm folder is owned by root and the ownership needs to be assigned back to your user. To fix it, since i installed nodejs under my username, was to change the permission of the ~/.npm folder to my
chown <USERNAME> ~/.npm
should get you up and running. Test both on Mac OS X and Ubuntu 12.10.
Leave a Reply