Skip to content

EPERM error with .local/share directory after installing CLI #521

@rosen-vladimirov

Description

@rosen-vladimirov

Problem

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions