I\'m getting a weird error:
Unhandled rejection Error: EACCES: permission denied, mkdir \'/home/ubuntu/.npm/_cacache/index-v5/14/36\'atus
I jus
Check the owner of the file with ls -l /problem/dir/
. The owner is probably set to root
, instead of myUserName
(i.e. TWoody
).
You will want to ch
ange own
er of the .npm/
globally first with chown
:
sudo chown -R $USER: ~/.npm/
.
And if this issue has crept into other /build/
directories after running npm run build
, you can go to those directories and run the same command:
sudo chown -R $USER: ./problem/dir/
Note that the chown
command is using the -R
flag to change the user ID and/or group ID for the hierarchies rooted in the files instead of just the files themselves. Also note that the argument $USER:
is taking your user name (i.e. myUserName
, TWoody
) and replacing the "group" ID (the second argument of null) of root
.