Jump to content

Node modules in Alfred scripts

Recommended Posts

Hi all, 

I'm trying to run a node.js script with Alfred, using this workaround: http://remy.bach.me.uk/blog/2014/03/writing-alfred-workflows-in-node/


It seems to work to get scripts to run without modules, but when I try to use the npm 'fast-csv' module, running the Alfred workflow with my script gives me the error "Cannot find the module 'fast-csv'". I've installed 'fast-csv' globally, so I'm not sure what else to try. (The script runs correctly when using the terminal.) Any ideas?



Share this post

Link to post

Welcome to the forums.


We can’t properly help you without access to your Workflow.

Debugging can already be hard with access to the code, and you’re asking us to guess yours from a description. There are multiple places where your code or Workflow setup may be going wrong. Without looking at it we’re shooting in the dark, which is a waste of time for everyone involved (including you).

Read the Reporting Problems with Workflows topic, as it gives a nice overview on how to build an effective report.

Share this post

Link to post

To add to what Vítor said, you’re having a problem with some non-standard software: Node.


That is to say, this isn’t purely an Alfred question. It’s quite possibly an issue with your own system that we can’t possibly replicate.


That’s the risk in using workflows written in things like Node. If you have a choice, it’s always safer to go with a workflow that’s “native” to macOS rather than one that requires non-standard platforms like Node.


Indeed, Node is particularly bad, as Node devs often have a brain-damaged approach to writing workflows.


Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...