@mumblebaj Just an idea: Maybe the node version used in Cron could be to old. When you run a script manually in your terminal, your full user environment (including things like .bashrc or .zshrc) is loaded. Cron runs in a much more minimal environment — it often doesn’t load your shell config files, so tools like nvm (Node Version Manager) might not be available.
How to fix it:
- Use the full path to Node: Find it with
which node
and use that path in your cron job.
- Set the environment manually in cron: You can define your PATH at the top of the cron file.
- Source nvm in your script: If you use nvm, add source
~/.nvm/nvm.sh
and nvm use <version>
before calling node.