在heroku中将应用程序从一种语言更改为另一种语言

发布于 2024-12-19 15:31:47 字数 803 浏览 5 评论 0原文

是否可以将 Cedar 堆栈上的 Heroku 应用程序从一种语言切换到另一种语言?

在这个特定的实例中,我尝试将应用程序从 PHP 迁移到 NodeJS,在执行 git push 后,该应用程序被检测为 NodeJS 应用程序:

-----> Heroku receiving push
-----> Node.js app detected
-----> Fetching Node.js binaries
-----> Vendoring node 0.4.7
-----> Installing dependencies with npm 1.0.94

       Dependencies installed
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size is 5.0MB
-----> Launching... done, v7

...但是它随后崩溃:

Error: No such file or directory - node main.js

尝试运行Node REPL 还表明该二进制文件不存在:

> heroku run node
Running node attached to terminal... up, run.1
sh: node: not found

有没有办法在不创建新实例的情况下重新初始化 Cedar 堆栈应用程序?

Is it possible to switch a Heroku app on the Cedar stack from one language to another?

In this particular instance I am trying to migrate an app from PHP to NodeJS, which is being detected as a NodeJS app after performing a git push:

-----> Heroku receiving push
-----> Node.js app detected
-----> Fetching Node.js binaries
-----> Vendoring node 0.4.7
-----> Installing dependencies with npm 1.0.94

       Dependencies installed
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size is 5.0MB
-----> Launching... done, v7

... however it then crashes with:

Error: No such file or directory - node main.js

Trying to run the Node REPL also suggests the binary doesn't exist:

> heroku run node
Running node attached to terminal... up, run.1
sh: node: not found

Is there any way to reinitialise a Cedar stack app, without creating a new instance?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鹿童谣 2024-12-26 15:31:47

创建一个新的实例应用程序实例。尝试将一种转变为另一种可能不是一个好主意。 DNS 会自动为您更新,因为这是由路由网格处理的,您会因此感到更加高兴和更好。

我(尽管用例略有不同)将应用程序从 Bamboo 迁移到 Cedar,整个过程花了我不到五分钟的时间。唯一的停机时间是我在应用程序上重新定位自定义域设置时的几秒钟。

Create a new instance application instance. It is probably not a good idea to try to morph one into the other. DNS will update for you automatically as that's handled by the routing mesh, and you'll be much happier and better off for it.

I (although a slightly different use case) migrated an application from Bamboo to Cedar and the whole process took me less than five minutes. The only downtime was a couple of seconds while I relocated the custom domain setup on the application.

泪之魂 2024-12-26 15:31:47

我知道这是一个老问题,但我在将应用程序从 PHP 更改为 NodeJs 时遇到了这个问题。我第一次运行 git push heroku master 时收到一条错误,指出它无法使用 PHP buildpack。

因此,我进入 Heroku 仪表板 中的应用程序 设置 选项卡,并从 Buildpacks 列表 中删除 PHP buildpack。
最后,当我运行 git push heroku master 时,Heroku 自动检测到 NodeJS 构建包。

I know it's an old question but I ran into this problem changing my app from PHP to NodeJs. The first time I run the git push heroku master I got an error saying that it couldn't use PHP buildpack.

So I went in my app Settings tab in Heroku dashboard and remove the PHP buildpack from the Buildpacks list.
Finally whe I ran git push heroku master, Heroku auto detected the NodeJS buildpack.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文