question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EPERM error with .local/share directory after installing CLI

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Agbongbenjcommented, Jan 23, 2018

sudo chown -R <username> ~/.local thanks the above solved it for me

0reactions
ammaratef45commented, Jul 9, 2018

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

EACCES: permission denied, open ‘/home/ammar/.local/share/.nativescript-cli/user-settings.json.lock’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: EPERM: operation not permitted, unlink · Issue #2464
Expected behavior No errors while executing npm install in ./assets directory. Actual behavior All commands are run as root/Administrator.
Read more >
npm - EPERM: operation not permitted on Windows
In my case, I was facing this error because my directory and its file were opened in my editor (VS code) while I...
Read more >
Error: EPERM: operation not permit… | Apple Developer Forums
I am installing packages for NODEJS/NPM and am receiving the following error, which, apparently, is not an error with the software, but with...
Read more >
Known Zowe CLI issues | Zowe Docs
Symptoms: After you install Zowe CLI, and the installation appears to complete successfully, Zowe commands that load the secure credential store ...
Read more >
Npm failed with return code: 4294963248, Error: EPERM
We have the `npm install` task that suddenly fails with Error: EPERM: operation not permitted, unlink 'C:\....\tsserver.js'. This was not happening before ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found