1

I'm trying to create a node script that will run on a keyboard command. I added a custom keyboard shortcut:

node /full/path/index.js

Also tried to create an executable bash script that will run the node command and it doesn't work.

bash commands run, but the node doesn't.

any ideas?

1 Answer 1

2

Manage to solve it - make the file a node js executable.

Steps:

1) Add a node shabang to the node.js script, usually:

#!/bin/env node

2) Define custom shortcut command as the full path to the file, i.e:

/full/path/to/file/index.js

3) Make file executable, using chmod:

sudo chmod +x /full/path/to/file/index.js

Hope it helps :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.