0

部署错误。如何解决这个问题?


2020-11-08T09:30:21.366810+00:00 app[web.1]: Error: libopencv_core.so.3.4: cannot open shared object file: No such file or directory
2020-11-08T09:30:21.366811+00:00 app[web.1]:     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
2020-11-08T09:30:21.366812+00:00 app[web.1]:     at Module.load (internal/modules/cjs/loader.js:812:32)
2020-11-08T09:30:21.366812+00:00 app[web.1]:     at Function.Module._load (internal/modules/cjs/loader.js:724:14)
2020-11-08T09:30:21.366812+00:00 app[web.1]:     at Module.require (internal/modules/cjs/loader.js:849:19)
2020-11-08T09:30:21.366813+00:00 app[web.1]:     at require (internal/modules/cjs/helpers.js:74:18)
2020-11-08T09:30:21.366813+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/opencv4nodejs/lib/cv.js:40:8)
2020-11-08T09:30:21.366813+00:00 app[web.1]:     at Module._compile (internal/modules/cjs/loader.js:956:30)
2020-11-08T09:30:21.366814+00:00 app[web.1]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
2020-11-08T09:30:21.366814+00:00 app[web.1]:     at Module.load (internal/modules/cjs/loader.js:812:32)
2020-11-08T09:30:21.366814+00:00 app[web.1]:     at Function.Module._load (internal/modules/cjs/loader.js:724:14)
2020-11-08T09:30:21.366814+00:00 app[web.1]:     at Module.require (internal/modules/cjs/loader.js:849:19)
2020-11-08T09:30:21.366815+00:00 app[web.1]:     at require (internal/modules/cjs/helpers.js:74:18)
2020-11-08T09:30:21.366815+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/opencv4nodejs/lib/opencv4nodejs.js:11:79)
2020-11-08T09:30:21.366815+00:00 app[web.1]:     at Module._compile (internal/modules/cjs/loader.js:956:30)
2020-11-08T09:30:21.366816+00:00 app[web.1]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
2020-11-08T09:30:21.366816+00:00 app[web.1]:     at Module.load (internal/modules/cjs/loader.js:812:32)

每次显示此错误时,应用程序都会崩溃。如何解决这个问题?

4

1 回答 1

0

按照以下步骤在 Heroku 中使用 Open CV

  1. heroku-buildpack-apt添加到您的 Heroku Build 包中。您可以转到应用程序的设置页面并添加构建包。
  2. 创建一个名为 Aptfile 的文件并添加以下库:libsm6、libxrender1、libfontconfig1、libice6。请按照以下示例进行操作:
libsm6
libxrender1
libfontconfig1
libice6
于 2020-11-10T01:38:07.643 回答