cronjob env: node: No such file or directory

$ mail
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/goliatone": 1 message 1 new
>N  1 goliatone@goliaedron.l  Thu Dec 17 23:58  19/838   "Cron <goliatone@goliaedron> /Users/goliatone/DEV/schedule-at-sunrise-and-sunset/bin/at-suncalc-date #SCHEDUL"
?
Message 1:
From goliatone@goliaedron.local  Thu Dec 17 23:58:04 2015
X-Original-To: goliatone
Delivered-To: goliatone@goliaedron.local
From: goliatone@goliaedron.local (Cron Daemon)
To: goliatone@goliaedron.local
Subject: Cron <goliatone@goliaedron> /Users/goliatone/DEV/schedule-at-sunrise-and-sunset/bin/at-suncalc-date #SCHEDULER: sunset-sunrise-test :: Scheduler for sunrise/sunset actions.
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=goliatone>
X-Cron-Env: <USER=goliatone>
X-Cron-Env: <HOME=/Users/goliatone>
Date: Thu, 17 Dec 2015 23:58:00 -0500 (EST)

env: node: No such file or directory

cron des not run in a login shell or a user's shell configuration but with a minimal one, which means that bash_profile and bashrc are not loaded. You can either use the full path to nodejs:

#!/usr/bin/env /usr/local/bin/node

Or load bashrc at the start of the cron job.

. $HOME/.bashrc

http://develify.com/whenever-gem-problem-ruby-no-such-file-or-directory/