check out my latest app: Online Check
and my latest blog post
Alfred 3 workflow to search for npm packages with npms.io
License: MIT License
check out my latest app: Online Check
and my latest blog post
I downloaded the workflow from http://www.packal.org/workflow/npms-0 and installed it, but I cannot get the search to work.
Typing npm <enter>
shows the expected screen
but any typing after that turns into a "normal" alfred search
I went into the workflow debugger and noticed the following debug output with each keystroke
Starting debug for 'npms'
[2016-06-27 09:42:47][ERROR: input.scriptfilter] Code 127: bash: cannot set terminal process group (18927): Inappropriate ioctl for device
bash: no job control in this shell
/Users/jschulz/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Scripts/BAA37249-3FCB-4A17-8851-29707885B376: line 9: node: command not found
node
is installed. I'm assuming that's a cascading failure originating from the cannot set terminal process group
error.
Let me know if I can do anything else to help debug or fix.
I followed the same steps and get the same behavior for https://github.com/sindresorhus/alfred-emoj. Let me know if you'd like me to open an issue there, as well.
npm install --global alfred-npms
> [email protected] postinstall /usr/local/lib/node_modules/alfred-npms
> alfy-init
{ Error: Command failed: alfred-link
Error: Workflow directory `/Users/dubba/repos/dotfiles-macbook-pro/alfred/Alfred.alfredpreferences/workflows` does not exist
at pathExists.then.exists (/usr/local/lib/node_modules/alfred-npms/node_modules/alfred-link/index.js:19:10)
at <anonymous>
at Promise.all.then.arr (/usr/local/lib/node_modules/alfred-npms/node_modules/execa/index.js:201:11)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:182:7)
code: 1,
killed: false,
stdout: '',
stderr: 'Error: Workflow directory `/Users/dubba/repos/dotfiles-macbook-pro/alfred/Alfred.alfredpreferences/workflows` does not exist\n at pathExists.then.exists (/usr/local/lib/node_modules/alfred-npms/node_modules/alfred-link/index.js:19:10)\n at <anonymous>\n',
failed: true,
signal: null,
cmd: 'alfred-link',
timedOut: 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! /Users/dubba/.npm/_logs/2018-04-12T19_01_01_940Z-debug.log
I'm using latest Alfred and this workflow stopped working for me.
The search never stops and the debugger output just shows:
[11:53:12.375] npms[Script Filter] Queuing argument 'r'
[11:53:12.432] npms[Script Filter] Queuing argument 're'
[11:53:12.519] npms[Script Filter] Queuing argument 'rea'
[11:53:12.668] npms[Script Filter] Queuing argument 'reac'
[11:53:12.816] npms[Script Filter] Queuing argument 'react'
Environment
When I type anything, an error occurs.
"items": [
{
"title": "RequestError: read ECONNRESET",
"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
"valid": false,
"text": {
"copy": "```\nRequestError: read ECONNRESET\n at ClientRequest.<anonymous> (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/got/dist/source/core/index.js:962:111)\n at ClientRequest.origin.emit (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)\n```\n\n-\nnpms 3.0.0\nAlfred 4.6.2\ndarwin 21.2.0",
"largetype": "RequestError: read ECONNRESET\n at ClientRequest.<anonymous> (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/got/dist/source/core/index.js:962:111)\n at ClientRequest.origin.emit (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)"
},
"icon": {
"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
}
}
]
I found this issue comment, request/request-promise#147 (comment), and I added Connection: 'keep-alive'
header to alfred-npms/node_modules/alfy/index.js:137
then the error has been resolved.
response = await got(url, {headers: {Connection: 'keep-alive'}, searchParams: options.query}).json();
Is there anyone else who experiences this error? I wonder if should add a Connection: 'keep-alive'
header to the alfy.fetch
.
I installed the workflow as suggested via the readme using npm install -g alfred-npms
. On opening my Alfred preferences all I get is a white window 😕
Fortunately enough everything works again after uninstalling via npm.
when I install alfred-npms , the npm raise an error
Error: Permission denied to read Alfred preferences at location /Users/manjusaka/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n
Hi,
I'm looking to see if you can publish this module into npm as I have just recently developed this app which is made to be compatible with existing alfy workflows. Right now it works with my own alfy module but would like to see if become fully compatible with other alfy modules.
Would be great if you would bundle it to a single workflow file. I use NVM and don't want to add alfred workflows in every version. This would get messy at some point.
Hi there,
I am getting the following error when I want to install this as an Alfred 4 Workflow:
error /Users/mbroder/.config/yarn/global/node_modules/alfred-npms: Command failed.
Exit code: 1
Command: alfy-init
Arguments:
Directory: /Users/mbroder/.config/yarn/global/node_modules/alfred-npms
Output:
{ Error: Command failed: alfred-link
Error: `Alfred.alfredpreferences` package does not exist
at resolveAlfredPrefs.then.then.prefsExists (/Users/mbroder/.config/yarn/global/node_modules/alfred-link/index.js:27:12)
at makeError (/Users/mbroder/.config/yarn/global/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/Users/mbroder/.config/yarn/global/node_modules/execa/index.js:278:16)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
code: 1,
stdout: '',
stderr:
'Error: `Alfred.alfredpreferences` package does not exist\n at resolveAlfredPrefs.then.then.prefsExists (/Users/mbroder/.config/yarn/global/node_modules/alfred-link/index.js:27:12)\n',
failed: true,
signal: null,
cmd: 'alfred-link',
timedOut: false,
killed: false }
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
Would be great if we can get it to work with Alfred 4
This is a great workflow! The only issue for me is syncing across different machines since I'd like to use this on both my work and personal computers. From the Alfred docs, I've set up dropbox to keep my workflows consistent but installing this on one machine removes it from the other.
We are using an enterprise registry served by https://github.com/cnpm/cnpmjs.org, and the API is compatable to npmjs.org. I want to use this workflow to search from our registry, but the result is different.
This way user can quickly search library and with modifier press instantly npm install
it.
I installed this package and I could invoke the search from Alfred. But, after that it falls back to default search.
Here is log using Alfred's debugger: https://gist.github.com/saneef/eb94a57bfd744461e304da5af1a0ddcc
What's going on here?
$ 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
Not sure if this is an issue with the alfred-link package, but it fails to find my user's Alfred preference files when install run as "sudo". However, on OS X to install packages globally, you must run as "sudo".
Here is the original NPM error:
[Error: Alfred preferences not found at location /Users/username/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist]
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "https://github.com/sindresorhus/alfred-npms.git"
npm ERR! node v5.7.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: alfred-link
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'alfred-link'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the alfred-npms package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! alfred-link
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs alfred-npms
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls alfred-npms
npm ERR! There is likely additional logging output above.
I confirmed the preferences plist is there at the path referenced above. I cloned the repo into the global folder at /usr/local/lib/node_modules and then did removed the post install script command, and did the "npm install -g" as sudo. Then I could manually run "alfred-link" in the directory (I had installed alfred-link globally via npm first).
So for example if I search for express and press return, it would open the github express page.
But if I search for express and press cmd + return on it, it would open npm page with express.
It would be extremely useful for me, I hope it can be added. Thank you.
I think it would be much useful than just going to the GitHub page. I usually want to reference the README as fast as possible and this allows that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.