alfred-link
alfred-link copied to clipboard
Install error with alfred-npms
What's going on here?
I kind of suspect this is similar to #7, but rather than running as root, it's running as the special _homebrew user (I use brewdo). It needs to be run by brewdo because node modules are in /usr/local/lib/node_modules
, which is owned by _homebrew rather than any particular user. This module should probably have a manual post-install step to be run for each user on their Alfred settings.
$ npm --global install alfred-npms
> [email protected] postinstall /usr/local/lib/node_modules/alfred-npms
> alfy-init
{ Error: Command failed: alfred-link
Error: Alfred preferences not found at location /var/folders/sh/xb5grs3d247c0cxy_7s57_2r0000gk/T/brewdo.2VFTfF5U/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist
at pathExists.then.exists (/usr/local/lib/node_modules/alfred-npms/node_modules/resolve-alfred-prefs/index.js:15:10)
at makeError (/usr/local/lib/node_modules/alfred-npms/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/usr/local/lib/node_modules/alfred-npms/node_modules/execa/index.js:278:16)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
code: 1,
stdout: '',
stderr:
'Error: Alfred preferences not found at location /var/folders/sh/xb5grs3d247c0cxy_7s57_2r0000gk/T/brewdo.2VFTfF5U/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n at pathExists.then.exists (/usr/local/lib/node_modules/alfred-npms/node_modules/resolve-alfred-prefs/index.js:15:10)\n',
failed: true,
signal: null,
cmd: 'alfred-link',
timedOut: false,
killed: false }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `alfy-init`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/folders/sh/xb5grs3d247c0cxy_7s57_2r0000gk/T/brewdo.2VFTfF5U/.npm/_logs/2019-02-23T03_35_58_148Z-debug.log
CC https://github.com/sindresorhus/alfred-npms/issues/25
(Sorry deleted my previous comment because I thought I found a fix, but I was wrong)
Also having this issue now, since I don't have my Alfred preferences synced in the default location: https://github.com/SamVerschueren/alfred-link/pull/20#issuecomment-472024948
I have mine in the default location (the cause seems to be the above), but useful to know there are multiple causes.
Which alfred version do you use?
This surely occurred using Alfred 3, since v4 wasn't out back when I reported it. That said, I just tested on v4, and the identical issue occurs.
It's weird that it tries to look for the Alfred.preferences file in this folder /var/folders/sh/xb5grs3d247c0cxy_7s57_2r0000gk/T/brewdo.2VFTfF5U/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist
. Or is that the location you picked in the Alfred settings?
Nope, it's not. Presumably this is an issue caused by interaction with brew
and its temporary HOME
env var.
Hello, I have the same issue with Travis builds using Node.js v10.16.3. I have same version of node installed locally on macOS and it works fine.
Failing build Node.js v10.16.3 https://travis-ci.org/skibitsky/alfred-timing/jobs/593542787
Successful build Node.js v8.16.1 https://travis-ci.org/skibitsky/alfred-timing/jobs/593542788
Same issue over here Not sure if it's related to the Alfred Preferences being in a shared folder on Dropbox.
> [email protected] postinstall /usr/local/lib/node_modules/alfred-figma
> alfy-init
Error: Command failed: alfred-link
Error: Permission denied to read Alfred preferences at location /var/root/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist
at module.exports (/usr/local/lib/node_modules/alfred-figma/node_modules/resolve-alfred-prefs/index.js:44:9)
at makeError (/usr/local/lib/node_modules/alfred-figma/node_modules/execa/index.js:174:9)
at /usr/local/lib/node_modules/alfred-figma/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
code: 1,
stdout: '',
stderr: 'Error: Permission denied to read Alfred preferences at location /var/root/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n' +
' at module.exports (/usr/local/lib/node_modules/alfred-figma/node_modules/resolve-alfred-prefs/index.js:44:9)\n',
failed: true,
signal: null,
cmd: 'alfred-link',
timedOut: false,
killed: false
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `alfy-init`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/root/.npm/_logs/2019-10-16T11_38_10_395Z-debug.log
I have the exact same issue here trying to install alfred-outline npm install --global alfred-outline
> [email protected] postinstall /usr/local/lib/node_modules/alfred-outline
> alfy-init
Error: Command failed with exit code 1 (EPERM): alfred-link
at makeError (/usr/local/lib/node_modules/alfred-outline/node_modules/execa/lib/error.js:59:11)
at handlePromise (/usr/local/lib/node_modules/alfred-outline/node_modules/execa/index.js:112:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async /usr/local/lib/node_modules/alfred-outline/node_modules/alfy/init.js:7:3 {
command: 'alfred-link',
exitCode: 1,
exitCodeName: 'EPERM',
stdout: '',
stderr: 'Error: Permission denied to read Alfred preferences at location /Users/carstenandersen/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n' +
' at module.exports (/usr/local/lib/node_modules/alfred-outline/node_modules/resolve-alfred-prefs/index.js:44:9)',
all: 'Error: Permission denied to read Alfred preferences at location /Users/carstenandersen/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n' +
' at module.exports (/usr/local/lib/node_modules/alfred-outline/node_modules/resolve-alfred-prefs/index.js:44:9)',
failed: true,
timedOut: false,
isCanceled: false,
killed: false,
signal: undefined
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `alfy-init`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/carstenandersen/.npm/_logs/2020-07-21T12_07_22_362Z-debug.log
How to work? I got the same error
Franks-MacBook-Pro-2:~ frankbian$ sudo npm install -g @bchatard/alfred-jetbrains
> [email protected] postinstall /usr/local/lib/node_modules/@bchatard/alfred-jetbrains/node_modules/fast-xml-parser
> node tasks/postinstall.js || exit 0
Love fast-xml-parser? Check https://amitkumargupta.work for more projects and contribution.
> @bchatard/[email protected] postinstall /usr/local/lib/node_modules/@bchatard/alfred-jetbrains
> alfy-init
Error: Command failed with exit code 1 (EPERM): alfred-link
at makeError (/usr/local/lib/node_modules/@bchatard/alfred-jetbrains/node_modules/alfy/node_modules/execa/lib/error.js:59:11)
at handlePromise (/usr/local/lib/node_modules/@bchatard/alfred-jetbrains/node_modules/alfy/node_modules/execa/index.js:112:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async /usr/local/lib/node_modules/@bchatard/alfred-jetbrains/node_modules/alfy/init.js:7:3 {
command: 'alfred-link',
exitCode: 1,
exitCodeName: 'EPERM',
stdout: '',
stderr: 'Error: Permission denied to read Alfred preferences at location /Users/frankbian/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n' +
' at module.exports (/usr/local/lib/node_modules/@bchatard/alfred-jetbrains/node_modules/resolve-alfred-prefs/index.js:44:9)',
all: 'Error: Permission denied to read Alfred preferences at location /Users/frankbian/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n' +
' at module.exports (/usr/local/lib/node_modules/@bchatard/alfred-jetbrains/node_modules/resolve-alfred-prefs/index.js:44:9)',
failed: true,
timedOut: false,
isCanceled: false,
killed: false,
signal: undefined
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @bchatard/[email protected] postinstall: `alfy-init`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @bchatard/[email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/frankbian/.npm/_logs/2020-11-03T10_00_45_867Z-debug.log