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

Permissions error when trying to install #4

Open
sinewave opened this issue Sep 29, 2020 · 1 comment
Open

Permissions error when trying to install #4

sinewave opened this issue Sep 29, 2020 · 1 comment

Comments

@sinewave
Copy link

I'm running into the following error when trying to install this worfklow.

I've tried running the command using sudo as well as changing the perms for NativeMessagingHosts to 777.

macOS 10.15.6
npm 6.14.6
node 12.18.4

[~]$ sudo npm install -g alfred-firefoxtabswitch

> alfred-firefoxtabswitch@1.1.1 postinstall /usr/local/lib/node_modules/alfred-firefoxtabswitch
> npm run-s generateAppManifest && alfy-init


> alfred-firefoxtabswitch@1.1.1 generateAppManifest /usr/local/lib/node_modules/alfred-firefoxtabswitch
> node generateAppManifest.js $(npm -g root)


┌────────────────────────────────────────────────────────────────┐
│                    npm update check failed                     │
│              Try running with sudo or get access               │
│              to the local update config store via              │
│ sudo chown -R $USER:$(id -gn $USER) /Users/tony/.config │
└────────────────────────────────────────────────────────────────┘
internal/fs/utils.js:269
    throw err;
    ^

Error: EACCES: permission denied, open '/Users/tony/Library/Application Support/Mozilla/NativeMessagingHosts/alfredtabswitch.json'
    at Object.openSync (fs.js:462:3)
    at Object.writeFileSync (fs.js:1362:35)
    at /usr/local/lib/node_modules/alfred-firefoxtabswitch/generateAppManifest.js:15:8
    at Object.<anonymous> (/usr/local/lib/node_modules/alfred-firefoxtabswitch/generateAppManifest.js:16:3)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/Users/tony/Library/Application Support/Mozilla/NativeMessagingHosts/alfredtabswitch.json'
}
@pyrho
Copy link
Owner

pyrho commented Sep 29, 2020

Hmm I don't run npm via sudo (and I think it's not advisable to do so either).
/Users/tony/Library/Application Support/Mozilla/NativeMessagingHosts/alfredtabswitch.json (the file to which you don't have permissions to) should really be readable by your user (root or not).

The "npm update check" failed message is from NPM itself, so I really think there is something wrong with your install.

Happy to help you tru it if you need.
First step would be to uninstall node (if installed via brew: brew uninstall node), and re-install it without messing with sudo.

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

2 participants