Raspberry pi / netlify deploy error

Hello, I’m encountering the following error when executing under cron and systemd timer. The CLI command works perfectly under interactive CLI. This issue is present under both node 16 and 20. Is this a known issue?


pi@raspberrypi:~ $ cat /etc/systemd/system/netlify.service

[Unit]

Description=deployment of rsynced wxwee html files to netlify

[Service]

Type=simple

User=pi

ExecStart=netlify deploy --debug --prod --dir /home/pi/rsync_target_dir

WorkingDirectory=/home/pi/rsync_target_dir

[Install]

WantedBy=multi-user.target

pi@raspberrypi:~ $


Oct 16 07:43:13 raspberrypi netlify[13614]: file:///home/pi/.nvm/versions/node/v20.8.1/lib/node_modules/netlify-cli/bin/run.mjs:12
Oct 16 07:43:13 raspberrypi netlify[13614]: const pkg = await getPackageJson()
Oct 16 07:43:13 raspberrypi netlify[13614]: ^^^^^
Oct 16 07:43:13 raspberrypi netlify[13614]: SyntaxError: Unexpected reserved word
Oct 16 07:43:13 raspberrypi netlify[13614]: at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
Oct 16 07:43:13 raspberrypi netlify[13614]: at async link (internal/modules/esm/module_job.js:42:21)
Oct 16 07:43:13 raspberrypi systemd[1]: netlify.service: Main process exited, code=exited, status=1/FAILURE
Oct 16 07:43:13 raspberrypi systemd[1]: netlify.service: Failed with result ‘exit-code’.

Reverting all the way back to v12.0.1 remedied the issue. Filed a bug report issue here: netlify deploy fails when executed under cron or systemd timer · Issue #6073 · netlify/cli · GitHub

Hi :wave:t6: thanks for filing the bug. Our devs will take a look in the near future.