Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netlify deploy fails when executed under cron or systemd timer #6073

Open
ahnj opened this issue Oct 16, 2023 · 0 comments
Open

netlify deploy fails when executed under cron or systemd timer #6073

ahnj opened this issue Oct 16, 2023 · 0 comments
Labels
type: bug code to address defects in shipped code

Comments

@ahnj
Copy link

ahnj commented Oct 16, 2023

Describe the bug

starting in v12.0.2, cron or systemd timer task netlify deploy --debug --prod --dir . fails with the error below. This issue presents itself under node 16, 18, and 20.

tail -f /var/log/syslog
Oct 16 16:35:43 raspberrypi netlify[24744]: file:///home/pi/.nvm/versions/node/v18.18.2/lib/node_modules/netlify-cli/bin/run.mjs:27
Oct 16 16:35:43 raspberrypi netlify[24744]:   await program.parseAsync(argv)
Oct 16 16:35:43 raspberrypi netlify[24744]:   ^^^^^
Oct 16 16:35:43 raspberrypi netlify[24744]: SyntaxError: Unexpected reserved word
Oct 16 16:35:43 raspberrypi netlify[24744]:     at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
Oct 16 16:35:43 raspberrypi netlify[24744]:     at async link (internal/modules/esm/module_job.js:42:21)

Steps to reproduce

  1. npm install -g netlify-cli@12.0.2
  2. create /etc/systemd/system/netlify.service
    [Unit]
    Description=deployment of rsynced wxwee html files to netlify

[Service]
Type=simple
User=pi
ExecStart=/home/pi/.nvm/versions/node/v18.18.2/bin/netlify deploy --prod --dir /home/pi/rsync_target_dir
WorkingDirectory=/home/pi/rsync_target_dir

[Install]
WantedBy=multi-user.target

  1. sudo systemctl daemon-reload; sudo systemctl restart netlify.service

Configuration

N/A

Environment


  System:
    OS: Linux 6.1 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) arm64 Cortex-A72
    Memory: 710.10 MB / 1.81 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
  npmGlobalPackages:
    netlify-cli: 12.0.1

pi@raspberrypi:~ $ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

1 participant