admin管理员组文章数量:1316690
I have a python script which runs as part of yarn build
for my static-site project deployed to Vercel. The script uses rsync
to do some file copying, using os.system
to make the call to rsync from within the python script: os.system(f"rsync -a {full_path} dest_path")
. This works great locally, however when I try to deploy to Vercel I get the error:
sh: line 1: rsync: command not found
I tried a few other approaches as well:
- using
subprocess.run(["npx", "rsync", "-a", full_path, dest_path], check=True)
to try get npx to run the command.
Vercel build error:
npm error could not determine executable to run
Tried adding rsync to my developer dependencies in package.json and retrying.
Finally I also tried using
rsync_path = subprocess.check_output(["which", "rsync"]).decode("utf-8").strip()
subprocess.run([rsync_path, "-a", full_path, dest_path], check=True)
Vercel build error:
error Command failed with exit code 1.
Is there a simple way for me to use rsync during my Vercel deployment? Does it even exist on the deployment machine? If not how can I set it up to use rsync
?
本文标签: pythoncommand not found when trying to use rsync on VercelStack Overflow
版权声明:本文标题:python - command not found when trying to use rsync on Vercel - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742000251a2410865.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论