our cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which has since been addressed.

our cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed. how can i fix this

Hi @umarhammanjoda

Note that this is not an Expo question.

Try running npm config get cache. That should in theory tell you where the cache is. (This might not be right if you have an environment variable that overrides the cache path.)

Then check what the ownership should be. e.g. if you have a user called “fred” and the NPM cache is in /Users/fred/.npm then check the ownership of the files in that location.

e.g.:

ls -l /Users/fred/.npm

On a Mac you’d probably see files owned by user “fred” and group “staff”. On Linux it group might also be “fred” instead of “staff”.

Then you can change all of the files/directories under that path to the same thing. e.g.:

sudo chown -R fred:staff /Users/fred/.npm