Skip to content

Instantly share code, notes, and snippets.

@4piu
Created November 17, 2022 02:40
Show Gist options
  • Save 4piu/3cc6bcde476c1fb7f8652fb06d3459e0 to your computer and use it in GitHub Desktop.
Save 4piu/3cc6bcde476c1fb7f8652fb06d3459e0 to your computer and use it in GitHub Desktop.
Use nvm in cron
# load nvm && go to working dir && use .nvmrc && execute script
* * * * * . ~/.nvm/nvm.sh && cd /tmp/ && nvm use && /tmp/test.js >> /tmp/test.js.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment