Node and crontab not working properly

cron, javascript, node.js

Solution

Change `node` to what comes from `which node`. That is, put full path of the binary executing process.

*/1 * * * * /path/to/node /home/me/path/to/script.js > /home/me/path/to/output
#           ^^^^^^^^^^^^^

The value is normally something like `/usr/bin/node`.

Problem

I am trying to run an node script with crontab but its not working as I expected (Ubuntu 12.04). In my crontab file I got `*/1 * * * * node /home/me/path/to/script.js > /home/me/path/to/output` This produces empty string output while it shouldn't. When I run `node /home/me/path/to/script.js > /home/me/path/to/output` though, manually, everything goes fine. Could you help me out with that?

Original source

Related problems