当我部署 Clojure 应用程序时,我需要 Node 程序 (NodeJS) 出现在 Heroku 的 dynos 中。我的应用程序不是 NodeJS 应用程序,例如它不能有 package.json,并且我不希望 Heroku 验证它是否是有效的 NodeJS 应用程序(它不是,它是一个 Clojure 应用程序)。
如何实现这一目标?
我尝试设置显式构建包:
$ heroku buildpacks
=== projectx Buildpack URLs
1. https://github.com/heroku/heroku-buildpack-nodejs
2. https://github.com/heroku/heroku-buildpack-clojure
但在部署时我仍然收到此错误消息:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Multipack app detected
remote: -----> Fetching custom git buildpack... done
remote:
remote: ! Push rejected, failed to detect
在日志中我可以看到:
2015-09-21T10:56:07.731335+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-21T10:56:07.731344+00:00 heroku[slug-compiler]: Slug compilation failed: no Cedar-supported app detected
2015-09-21T10:56:07.731346+00:00 heroku[slug-compiler]: HINT: This occurs when Heroku cannot detect the buildpack
2015-09-21T10:56:07.731347+00:00 heroku[slug-compiler]: to use for this application automatically.
2015-09-21T10:56:07.731348+00:00 heroku[slug-compiler]: See https://devcenter.heroku.com/articles/buildpacks
2015-09-21T10:58:07.541720+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-21T10:58:07.541729+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect
2015-09-21T11:00:28.651321+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-21T11:00:28.651329+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect
最佳答案
尝试将包含以下内容的 package.json
文件添加到您的项目中:
{}
Node.js 构建包必须检测到这个最小配置才能运行。
确保 package.json
文件也提交到 Git。
关于node.js - 将 NodeJS 添加到 Heroku 中的 Clojure 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32693625/