gpt4 book ai didi

java - heroku Nodejs 应用程序 - events.js :167 Error Unhandled 'error' event : spawn java ENOENT

转载 作者:行者123 更新时间:2023-12-02 10:34:52 25 4
gpt4 key购买 nike

我在 Heroku 上有一个使用 pdfMerge.js 库的 Node-js 应用程序。

documentation之后我使用流事件机制作为回调来识别进程的结束

然后抛出异常:events.js:167 错误:生成 java ENOENT。

我几乎可以肯定它正在发生,因为我弄乱了所需的 java 安装,如下所述:

pdfmerger combines multiple PDF-files into a single PDF-file. It is a node module that utilizes the Apache PDFBox Library, which the required functionality are distributed along with this module. The only requirement for this module to run, is having Java 6 or higher in the path.

我对 Heroku 安装/配置过程不够熟悉,无法使其正常工作。

提前致谢

最佳答案

您可以通过添加 heroku/jvm 构建包来将 Java 添加到您的应用程序中,如下所示:

$ heroku buildpacks:add -i 1 heroku/jvm

然后使用 git commit --allow-emptygit push heroku master 重新部署。

关于java - heroku Nodejs 应用程序 - events.js :167 Error Unhandled 'error' event : spawn java ENOENT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53362650/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com