【发布时间】:2019-02-10 13:59:39
【问题描述】:
我尝试使用 heroku 插件“调度程序”运行 myFile。
简化的文件结构(MyProject 为根)
MyProject -> bin -> myFile
我的文件
#!/usr/bin/env node
const foo = require('myFunc');
foo();
process.exit();
从我的电脑本地测试 heroku-cli bash 中的 MyFile,它按预期工作。但是我 Heroku 调度程序 cmd 很可能是错误的,因为调度程序在指定时间触发,我在日志中收到以下错误:
2018-09-05T12:00:08.323971+00:00 app[api]: Starting process with command `run eovendoEarnMoney` by user scheduler@addons.heroku.com
2018-09-05T12:01:05.759152+00:00 heroku[scheduler.4007]: Starting process with command `run myFile`
2018-09-05T12:01:06.419284+00:00 heroku[scheduler.4007]: State changed from starting to up
2018-09-05T12:01:08.283555+00:00 heroku[scheduler.4007]: State changed from up to complete
2018-09-05T12:01:08.223306+00:00 heroku[scheduler.4007]: Process exited with status 127
2018-09-05T12:01:08.154580+00:00 app[scheduler.4007]: bash: heroku: command not found
我尝试将 bash 命令(在上图中)更改为:run myFile。导致同样的错误,只是这次的错误是:
2018-09-05T12:01:08.154580+00:00 app[scheduler.4007]: bash: run: command not found
我在 this answer 之后为 heroku-cli 添加了一个构建包,因为我认为这会有所帮助。
运行“myFile”的正确命令是什么?
没有关于此事的文件
【问题讨论】:
标签: javascript node.js bash heroku heroku-cli