Permissions error when trying to install
sinewave opened this issue · 1 comments
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'
}
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
.