可以使用库pdf-creator节点生成文件pdf错误phantomjs

发布于 2025-02-07 11:14:43 字数 1357 浏览 0 评论 0原文

错误:Spawn/app/node_modules/phantomjs-prebuilt/lib/phantom/phantom/bin/phantomjs in process.childprocess._handle._handle.onexit(internal/child_process.js:277:19)aterrornt(insern/conser/childrornt) 16)在processTickSandReptions in internal/process/task_queues.js:82:21){errno:-2,代码:'enoent',syscall:'Spawn/app/app/node_modules/phantomjs -prebuilt/lib/lib/lib/lib/phantom/phantom/bin/bin/phantomjs',路径:'/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',spawnargs:[' - local-url-access = false' pdf_a4_portrait.js']}}您已经触发了一个未经用的拒绝,您可能已经忘记了抓住承诺拒绝:错误[ERR_HTTP_HEADERS_SENT]:无法在将标题发送给客户端后在New NodeError上发送给客户)在serverresponse.setheader(_HTTP_OUTONGY DOONGE.JS:561:11)at SERVERRESPONSE.HEADER(/app/node_modules/express/express/lib/response.js:794:10)响应:174:12)在serverresponse.json(/app/node_modules/express/lib/response.js:278:15)at/app/libs/response.js:51:26) app/routes/pdf.js:25:14在processTickSandRepoxtions(内部/process/task_queues.js:95:5)此错误源于在没有捕获块的情况下将异步功能的投掷到内部,或者是拒绝没有诺言的诺言使用.catch()处理。拒绝承诺的原因是:错误[err_http_headers_sent]:无法将标题发送到new Nodeerror(new nodeerror(internal/errors.js:322:7)的客户端,serverresponse.setheader(_htttp_outonovey.js:561:11)at serverresponse.js:561:11)at serverresponse.js:794:10) /node_modules/express/lib/response.js:278:15)在object.fail(/app/libs/response.js:51:26)at/app/routes/pdf.js:25:14 /process/task_queues.js:95:5)

Error: spawn /app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:277:19) at onErrorNT (internal/child_process.js:472:16) at processTicksAndRejections internal/process/task_queues.js:82:21) { errno: -2, code: 'ENOENT', syscall: 'spawn /app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs', path: '/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs', spawnargs: [ '--local-url-access=false', '/app/node_modules/html-pdf/lib/scripts/pdf_a4_portrait.js' ] } You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at new NodeError (internal/errors.js:322:7) at ServerResponse.setHeader (_http_outgoing.js:561:11) at ServerResponse.header (/app/node_modules/express/lib/response.js:794:10) at ServerResponse.send (/app/node_modules/express/lib/response.js:174:12) at ServerResponse.json (/app/node_modules/express/lib/response.js:278:15) at Object.fail (/app/libs/response.js:51:26) at /app/routes/pdf.js:25:14 at processTicksAndRejections (internal/process/task_queues.js:95:5) This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at new NodeError (internal/errors.js:322:7) at ServerResponse.setHeader (_http_outgoing.js:561:11) at ServerResponse.header (/app/node_modules/express/lib/response.js:794:10) at ServerResponse.send (/app/node_modules/express/lib/response.js:174:12) at ServerResponse.json (/app/node_modules/express/lib/response.js:278:15) at Object.fail (/app/libs/response.js:51:26) at /app/routes/pdf.js:25:14 at processTicksAndRejections (internal/process/task_queues.js:95:5)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文