EPERM error with .local/share directory after installing CLI
See original GitHub issueProblem
In case on Mac and Linux I do not have ~/.local directory, after installing CLI with sudo sudo npm i -g nativescript
, I cannot access ~/.local and ~/.local/share directories. Some other applications are trying to use them after that and they are failing as the directories are created with root owner instead of my own user.
Implementation details
The reason is that we are creating .nativescript-cli cache directory insider ~/.local/share and if the path above does not exist, installing CLI with sudo leads to creation of ~/.local and ~/.local/share directories with root owner. Inside CLI we have code to change the owner of .nativescript-cli directory to current user, but it is not applied to ~/.local and ~/.local/share directories which may have been created from the same process.
Workaround
The workaround is to change the owner of ~/.local and all its subdirectories to your user.
sudo chown -R <username> ~/.local
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
sudo chown -R <username> ~/.local thanks the above solved it for me
I have similar issue I have ubuntu 14.04, tried
sudo chown ammar -R ~/.local
where ammar is my user name but the issue still there