Getting `Error: EACCES: permission denied` when running `npm install --save-dev babel-plugin-styled-components`
Hello I would like to thank all of you for contributing and making this amazing lib for the community. Big applause to every one of you!
I tried to install today this babel-plugin to my local machine and hot the following error,
npm ERR! path /Users/xxxx/.npm/_cacache/index-v5/b2/8b/yyyy
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/Users/xxxx/.npm/_cacache/index-v5/b2/8b/yyyy'
npm ERR! { [Error: EACCES: permission denied, open '/Users/xxxx/.npm/_cacache/index-v5/b2/8b/yyyy']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, open '/Users/xxxx/.npm/_cacache/index-v5/b2/8b/yyyy'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path:
npm ERR! '/Users/xxxx/.npm/_cacache/index-v5/b2/8b/yyyy' },
npm ERR! isOperational: true,
npm ERR! stack:
npm ERR! "Error: EACCES: permission denied, open '/Users/christos/.npm/_cacache/index-v5/b2/8b/yyyy'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path:
npm ERR! '/Users/xxxx/.npm/_cacache/index-v5/b2/8b/yyyy' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxx/.npm/_logs/2019-04-15T11_01_48_624Z-debug.log
Please let me know if anyone had this before. I suspect that this might be an issue with my local machine but I cant really tell why I get this when before I could install the package out of the box.
Also happy to open a PR to fix this ofc :D Let me know !!
This is generally due to local permissions on your computer. Check the answers out in this thread: https://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo
this is correct. thanks for taking the time to respond to this!
Its possible the package name changed. Google it and see if theres a newer version.