Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: EACCES: permission denied #108

Open
GPL71 opened this issue Sep 2, 2019 · 6 comments
Open

Error: EACCES: permission denied #108

GPL71 opened this issue Sep 2, 2019 · 6 comments

Comments

@GPL71
Copy link

GPL71 commented Sep 2, 2019

Hello
Thank you for your work!!!

Please can you help me solve follow problem?
User is "pi"
Thank you

[2019-9-2 19:02:14] Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/homebridge-people/node_modules/node-persist/storage'
at Object.fs.mkdirSync (fs.js:902:18)
at sync (/usr/local/lib/node_modules/homebridge-people/node_modules/mkdirp/index.js:55:12)
at sync (/usr/local/lib/node_modules/homebridge-people/node_modules/mkdirp/index.js:61:24)
at Function.sync (/usr/local/lib/node_modules/homebridge-people/node_modules/mkdirp/index.js:61:24)
at LocalStorage.parseDirSync (/usr/local/lib/node_modules/homebridge-people/node_modules/node-persist/local-storage.js:615:20)
at LocalStorage.parseDataDirSync (/usr/local/lib/node_modules/homebridge-people/node_modules/node-persist/local-storage.js:545:21)
at LocalStorage.initSync (/usr/local/lib/node_modules/homebridge-people/node_modules/node-persist/local-storage.js:145:14)
at Object.nodePersist.initSync (/usr/local/lib/node_modules/homebridge-people/node_modules/node-persist/node-persist.js:41:29)
at new PeoplePlatform (/usr/local/lib/node_modules/homebridge-people/index.js:36:18)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:337:32)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

@cruzquer
Copy link

Run the following code:

$ sudo su
$ chown -R homebridge: chown -R homebridge: /usr/local/lib/node_modules/homebridge-people/

It fixes the permissions as the homebridge-people folder is only granted permissions for root user.

@GPL71
Copy link
Author

GPL71 commented Nov 27, 2019

not seem works ...
Schermata 2019-11-27 alle 21 37 42

Please can you understanding why?
Thankyou

@sschuste
Copy link

Run the following code:

$ sudo su
$ chown -R homebridge: chown -R homebridge: /usr/local/lib/node_modules/homebridge-people/

It fixes the permissions as the homebridge-people folder is only granted permissions for root user.

This is not a good idea. You should never "fix" permissions that are granted for the root user. And to run a chown for a user homebridge that might not be available on a specific system is also not a good idea as it results in the error message of @GPL71

The default setting "cacheDirectory": "./.node-persist/storage", is only working then if you run your homebridge as root, which is not a good idea. So the default setting itself is not a good idea.

Unbelievable, this plugin is so great and I love it and it works every day for me but it creates only bad ideas :-D

Set "cacheDirectory": "./.node-persist/storage", to a path where you allowed to write. This is a good idea. If you start homebridge as user pi then /home/pi/.homebridge/node-persist/storage and you should be fine. If you don't know which user you use to start homebridge you could write it to /tmp/node-persist/storage - unfortunately this path is deleted after every reboot of your machine. Good idea? Not sure.

When I look to the code it seems that everything is working automatically when you just set no path. So _"cacheDirectory": "", could be a solution.

@DiegoRenau
Copy link

chown -R pi: /usr/local/lib/node_modules/homebridge-people/

Thanks.

@dick7005
Copy link

EACCES: permission denied, unlink '/home/user/Desktop/Git-srch-engine/Github-search-master/dist/Github-search/wwod.jpg'

help plz

@MDOBreno
Copy link

SOLVED on Mac by running on terminal:

$ chown -R YourMacUsername: /Users/YourMacUsername/.npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@DiegoRenau @GPL71 @sschuste @MDOBreno @cruzquer @dick7005 and others