【问题标题】:Issue deploying pdf-fill-form to heroku将pdf-fill-form部署到heroku的问题
【发布时间】:2021-12-04 20:04:05
【问题描述】:

我有一个简单的节点应用程序来填写 PDF 文档。在本地 Linux VM 上,它可以正常工作。当我尝试在 Heroku 上部署时,构建阶段崩溃了。

最初的测试用例是,

  1. 添加构建包https://github.com/heroku/heroku-buildpack-apt
  2. 在 Github 上创建 Aptfile
  3. 包括 pdf-fill-form 包 (libcairo2-dev) 的 Linux 依赖项 libpoppler-qt5-dev poppler-data)

通过此设置构建成功,但由于 procfile 显示 web: node server.js,它正在尝试运行节点服务器。此时,我意识到我错过了一个构建包。 因此,我尝试在 buildpacks 上添加 heroku/nodejs,并尝试重新部署该应用程序。现在,它甚至无法正确编译 pdf-fill-form 包。

https://www.npmjs.com/package/pdf-fill-form

在这里你可以看到所有的构建日志

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
       1. https://github.com/heroku/heroku-buildpack-apt
       2. heroku/nodejs
-----> Apt app detected
-----> Reusing cache
-----> Updating apt caches
       Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
       Hit:2 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
       Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease
       Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
       Reading package lists...
-----> Fetching .debs for libcairo2-dev
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
       Need to get 0 B/627 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Download complete and in download only mode
-----> Fetching .debs for libpoppler-qt5-dev
       Reading package lists...
       Building dependency tree...
       The following additional packages will be installed:
         adwaita-icon-theme at-spi2-core dbus dbus-user-session
         dconf-gsettings-backend dconf-service dmsetup glib-networking
         glib-networking-common glib-networking-services gsettings-desktop-schemas
         gtk-update-icon-cache humanity-icon-theme libapparmor1 libatk-bridge2.0-0
         libatk1.0-0 libatk1.0-data libatspi2.0-0 libcolord2 libcryptsetup12
         libdconf1 libdevmapper1.02.1 libdouble-conversion3 libdrm-amdgpu1
         libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2
         libegl-dev libegl-mesa0 libegl1 libepoxy0 libevdev2 libgbm1 libgl-dev libgl1
         libgl1-mesa-dri libglapi-mesa libglu1-mesa libglu1-mesa-dev libglvnd0
         libglx-dev libglx-mesa0 libglx0 libgtk-3-0 libgtk-3-bin libgtk-3-common
         libgudev-1.0-0 libinput-bin libinput10 libip4tc2 libjson-glib-1.0-0
         libjson-glib-1.0-common libllvm12 libmtdev1 libnspr4 libnss-systemd libnss3
         libpam-systemd libpciaccess0 libpoppler-dev libpoppler-qt5-1 libpoppler97
         libproxy1v5 libqt5concurrent5 libqt5core5a libqt5dbus5 libqt5gui5
         libqt5network5 libqt5opengl5 libqt5opengl5-dev libqt5printsupport5
         libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5test5 libqt5widgets5
         libqt5xml5 librest-0.7-0 libsensors-config libsensors5 libsoup-gnome2.4-1
         libsoup2.4-1 libvulkan-dev libvulkan1 libwacom-bin libwacom-common libwacom2
         libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0
         libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-icccm4
         libxcb-image0 libxcb-keysyms1 libxcb-present0 libxcb-randr0
         libxcb-render-util0 libxcb-shape0 libxcb-sync1 libxcb-util1 libxcb-xfixes0
         libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxcomposite1 libxcursor1
         libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon-x11-0 libxkbcommon0
         libxrandr2 libxshmfence1 libxtst6 libxxf86vm1 mesa-vulkan-drivers
         networkd-dispatcher python3-dbus python3-gi qt5-gtk-platformtheme qt5-qmake
         qt5-qmake-bin qtbase5-dev qtbase5-dev-tools qtchooser qttranslations5-l10n
         systemd systemd-sysv systemd-timesyncd ubuntu-mono xkb-data
       Suggested packages:
         colord gvfs pciutils qt5-image-formats-plugins qtwayland5 lm-sensors iw
         | wireless-tools python-dbus-doc python3-dbus-dbg default-libmysqlclient-dev
         firebird-dev libsqlite3-dev unixodbc-dev systemd-container policykit-1
       The following NEW packages will be installed:
         adwaita-icon-theme at-spi2-core dbus dbus-user-session
         dconf-gsettings-backend dconf-service dmsetup glib-networking
         glib-networking-common glib-networking-services gsettings-desktop-schemas
         gtk-update-icon-cache humanity-icon-theme libapparmor1 libatk-bridge2.0-0
         libatk1.0-0 libatk1.0-data libatspi2.0-0 libcolord2 libcryptsetup12
         libdconf1 libdevmapper1.02.1 libdouble-conversion3 libdrm-amdgpu1
         libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2
         libegl-dev libegl-mesa0 libegl1 libepoxy0 libevdev2 libgbm1 libgl-dev libgl1
         libgl1-mesa-dri libglapi-mesa libglu1-mesa libglu1-mesa-dev libglvnd0
         libglx-dev libglx-mesa0 libglx0 libgtk-3-0 libgtk-3-bin libgtk-3-common
         libgudev-1.0-0 libinput-bin libinput10 libip4tc2 libjson-glib-1.0-0
         libjson-glib-1.0-common libllvm12 libmtdev1 libnspr4 libnss-systemd libnss3
         libpam-systemd libpciaccess0 libpoppler-dev libpoppler-qt5-1
         libpoppler-qt5-dev libpoppler97 libproxy1v5 libqt5concurrent5 libqt5core5a
         libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5opengl5-dev
         libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5test5
         libqt5widgets5 libqt5xml5 librest-0.7-0 libsensors-config libsensors5
         libsoup-gnome2.4-1 libsoup2.4-1 libvulkan-dev libvulkan1 libwacom-bin
         libwacom-common libwacom2 libwayland-client0 libwayland-cursor0
         libwayland-egl1 libwayland-server0 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0
         libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present0
         libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-sync1 libxcb-util1
         libxcb-xfixes0 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxcomposite1
         libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon-x11-0
         libxkbcommon0 libxrandr2 libxshmfence1 libxtst6 libxxf86vm1
         mesa-vulkan-drivers networkd-dispatcher python3-dbus python3-gi
         qt5-gtk-platformtheme qt5-qmake qt5-qmake-bin qtbase5-dev qtbase5-dev-tools
         qtchooser qttranslations5-l10n systemd systemd-sysv systemd-timesyncd
         ubuntu-mono xkb-data
       0 upgraded, 139 newly installed, 0 to remove and 1 not upgraded.
       Need to get 0 B/67.0 MB of archives.
       After this operation, 623 MB of additional disk space will be used.
       Download complete and in download only mode
-----> Fetching .debs for poppler-data
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
       Need to get 0 B/1,475 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Download complete and in download only mode
-----> Installing adwaita-icon-theme_3.36.1-2ubuntu0.20.04.2_all.deb
-----> Installing at-spi2-core_2.36.0-2_amd64.deb
-----> Installing dbus_1.12.16-2ubuntu2.1_amd64.deb
-----> Installing dbus-user-session_1.12.16-2ubuntu2.1_amd64.deb
-----> Installing dconf-gsettings-backend_0.36.0-1_amd64.deb
-----> Installing dconf-service_0.36.0-1_amd64.deb
-----> Installing dmsetup_2%3a1.02.167-1ubuntu1_amd64.deb
-----> Installing glib-networking_2.64.2-1ubuntu0.1_amd64.deb
-----> Installing glib-networking-common_2.64.2-1ubuntu0.1_all.deb
-----> Installing glib-networking-services_2.64.2-1ubuntu0.1_amd64.deb
-----> Installing gsettings-desktop-schemas_3.36.0-1ubuntu1_all.deb
-----> Installing gtk-update-icon-cache_3.24.20-0ubuntu1_amd64.deb
-----> Installing humanity-icon-theme_0.6.15_all.deb
-----> Installing libapparmor1_2.13.3-7ubuntu5.1_amd64.deb
-----> Installing libatk1.0-0_2.35.1-1ubuntu2_amd64.deb
-----> Installing libatk1.0-data_2.35.1-1ubuntu2_all.deb
-----> Installing libatk-bridge2.0-0_2.34.2-0ubuntu2~20.04.1_amd64.deb
-----> Installing libatspi2.0-0_2.36.0-2_amd64.deb
-----> Installing libcairo2-dev_1.16.0-4ubuntu1_amd64.deb
-----> Installing libcolord2_1.4.4-2_amd64.deb
-----> Installing libcryptsetup12_2%3a2.2.2-3ubuntu2.3_amd64.deb
-----> Installing libdconf1_0.36.0-1_amd64.deb
-----> Installing libdevmapper1.02.1_2%3a1.02.167-1ubuntu1_amd64.deb
-----> Installing libdouble-conversion3_3.1.5-4ubuntu1_amd64.deb
-----> Installing libdrm2_2.4.105-3~20.04.2_amd64.deb
-----> Installing libdrm-amdgpu1_2.4.105-3~20.04.2_amd64.deb
-----> Installing libdrm-common_2.4.105-3~20.04.2_all.deb
-----> Installing libdrm-intel1_2.4.105-3~20.04.2_amd64.deb
-----> Installing libdrm-nouveau2_2.4.105-3~20.04.2_amd64.deb
-----> Installing libdrm-radeon1_2.4.105-3~20.04.2_amd64.deb
-----> Installing libegl1_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libegl-dev_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libegl-mesa0_21.0.3-0ubuntu0.3~20.04.3_amd64.deb
-----> Installing libepoxy0_1.5.4-1_amd64.deb
-----> Installing libevdev2_1.9.0+dfsg-1ubuntu0.1_amd64.deb
-----> Installing libgbm1_21.0.3-0ubuntu0.3~20.04.3_amd64.deb
-----> Installing libgl1_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libgl1-mesa-dri_21.0.3-0ubuntu0.3~20.04.3_amd64.deb
-----> Installing libglapi-mesa_21.0.3-0ubuntu0.3~20.04.3_amd64.deb
-----> Installing libgl-dev_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libglu1-mesa_9.0.1-1build1_amd64.deb
-----> Installing libglu1-mesa-dev_9.0.1-1build1_amd64.deb
-----> Installing libglvnd0_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libglx0_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libglx-dev_1.3.2-1~ubuntu0.20.04.1_amd64.deb
-----> Installing libglx-mesa0_21.0.3-0ubuntu0.3~20.04.3_amd64.deb
-----> Installing libgtk-3-0_3.24.20-0ubuntu1_amd64.deb
-----> Installing libgtk-3-bin_3.24.20-0ubuntu1_amd64.deb
-----> Installing libgtk-3-common_3.24.20-0ubuntu1_all.deb
-----> Installing libgudev-1.0-0_1%3a233-1_amd64.deb
-----> Installing libinput10_1.15.5-1ubuntu0.2_amd64.deb
-----> Installing libinput-bin_1.15.5-1ubuntu0.2_amd64.deb
-----> Installing libip4tc2_1.8.4-3ubuntu2_amd64.deb
-----> Installing libjson-glib-1.0-0_1.4.4-2ubuntu2_amd64.deb
-----> Installing libjson-glib-1.0-common_1.4.4-2ubuntu2_all.deb
-----> Installing libllvm12_1%3a12.0.0-3ubuntu1~20.04.4_amd64.deb
-----> Installing libmtdev1_1.1.5-1.1_amd64.deb
-----> Installing libnspr4_2%3a4.25-1_amd64.deb
-----> Installing libnss3_2%3a3.49.1-1ubuntu1.5_amd64.deb
-----> Installing libnss-systemd_245.4-4ubuntu3.13_amd64.deb
-----> Installing libpam-systemd_245.4-4ubuntu3.13_amd64.deb
-----> Installing libpciaccess0_0.16-0ubuntu1_amd64.deb
-----> Installing libpoppler97_0.86.1-0ubuntu1_amd64.deb
-----> Installing libpoppler-dev_0.86.1-0ubuntu1_amd64.deb
-----> Installing libpoppler-qt5-1_0.86.1-0ubuntu1_amd64.deb
-----> Installing libpoppler-qt5-dev_0.86.1-0ubuntu1_amd64.deb
-----> Installing libproxy1v5_0.4.15-10ubuntu1.2_amd64.deb
-----> Installing libqt5concurrent5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5core5a_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5dbus5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5gui5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5network5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5opengl5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5opengl5-dev_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5printsupport5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5sql5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5sql5-sqlite_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5svg5_5.12.8-0ubuntu1_amd64.deb
-----> Installing libqt5test5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5widgets5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing libqt5xml5_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing librest-0.7-0_0.8.1-1_amd64.deb
-----> Installing libsensors5_1%3a3.6.0-2ubuntu1_amd64.deb
-----> Installing libsensors-config_1%3a3.6.0-2ubuntu1_all.deb
-----> Installing libsoup2.4-1_2.70.0-1_amd64.deb
-----> Installing libsoup-gnome2.4-1_2.70.0-1_amd64.deb
-----> Installing libvulkan1_1.2.131.2-1_amd64.deb
-----> Installing libvulkan-dev_1.2.131.2-1_amd64.deb
-----> Installing libwacom2_1.3-2ubuntu3_amd64.deb
-----> Installing libwacom-bin_1.3-2ubuntu3_amd64.deb
-----> Installing libwacom-common_1.3-2ubuntu3_all.deb
-----> Installing libwayland-client0_1.18.0-1_amd64.deb
-----> Installing libwayland-cursor0_1.18.0-1_amd64.deb
-----> Installing libwayland-egl1_1.18.0-1_amd64.deb
-----> Installing libwayland-server0_1.18.0-1_amd64.deb
-----> Installing libx11-xcb1_2%3a1.6.9-2ubuntu1.2_amd64.deb
-----> Installing libxcb-dri2-0_1.14-2_amd64.deb
-----> Installing libxcb-dri3-0_1.14-2_amd64.deb
-----> Installing libxcb-glx0_1.14-2_amd64.deb
-----> Installing libxcb-icccm4_0.4.1-1.1_amd64.deb
-----> Installing libxcb-image0_0.4.0-1build1_amd64.deb
-----> Installing libxcb-keysyms1_0.4.0-1build1_amd64.deb
-----> Installing libxcb-present0_1.14-2_amd64.deb
-----> Installing libxcb-randr0_1.14-2_amd64.deb
-----> Installing libxcb-render-util0_0.3.9-1build1_amd64.deb
-----> Installing libxcb-shape0_1.14-2_amd64.deb
-----> Installing libxcb-sync1_1.14-2_amd64.deb
-----> Installing libxcb-util1_0.4.0-0ubuntu3_amd64.deb
-----> Installing libxcb-xfixes0_1.14-2_amd64.deb
-----> Installing libxcb-xinerama0_1.14-2_amd64.deb
-----> Installing libxcb-xinput0_1.14-2_amd64.deb
-----> Installing libxcb-xkb1_1.14-2_amd64.deb
-----> Installing libxcomposite1_1%3a0.4.5-1_amd64.deb
-----> Installing libxcursor1_1%3a1.2.0-2_amd64.deb
-----> Installing libxdamage1_1%3a1.1.5-2_amd64.deb
-----> Installing libxfixes3_1%3a5.0.3-2_amd64.deb
-----> Installing libxi6_2%3a1.7.10-0ubuntu1_amd64.deb
-----> Installing libxinerama1_2%3a1.1.4-2_amd64.deb
-----> Installing libxkbcommon0_0.10.0-1_amd64.deb
-----> Installing libxkbcommon-x11-0_0.10.0-1_amd64.deb
-----> Installing libxrandr2_2%3a1.5.2-0ubuntu1_amd64.deb
-----> Installing libxshmfence1_1.3-1_amd64.deb
-----> Installing libxtst6_2%3a1.2.3-1_amd64.deb
-----> Installing libxxf86vm1_1%3a1.1.4-1build1_amd64.deb
-----> Installing mesa-vulkan-drivers_21.0.3-0ubuntu0.3~20.04.3_amd64.deb
-----> Installing networkd-dispatcher_2.1-2~ubuntu20.04.1_all.deb
-----> Installing poppler-data_0.4.9-2_all.deb
-----> Installing python3-dbus_1.2.16-1build1_amd64.deb
-----> Installing python3-gi_3.36.0-1_amd64.deb
-----> Installing qt5-gtk-platformtheme_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing qt5-qmake_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing qt5-qmake-bin_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing qtbase5-dev_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing qtbase5-dev-tools_5.12.8+dfsg-0ubuntu1_amd64.deb
-----> Installing qtchooser_66-2build1_amd64.deb
-----> Installing qttranslations5-l10n_5.12.8-0ubuntu1_all.deb
-----> Installing systemd_245.4-4ubuntu3.13_amd64.deb
-----> Installing systemd-sysv_245.4-4ubuntu3.13_amd64.deb
-----> Installing systemd-timesyncd_245.4-4ubuntu3.13_amd64.deb
-----> Installing ubuntu-mono_19.04-0ubuntu3_all.deb
-----> Installing xkb-data_2.29-2_all.deb
-----> Writing profile script
-----> Rewrite package-config files
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  12.17
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 12.17...
       Downloading and installing node 12.17.0...
       Using default npm version: 6.14.4
       
-----> Installing dependencies
       Installing node modules
       
       > nodemon@2.0.4 postinstall /tmp/build_83a779a9/node_modules/nodemon
       > node bin/postinstall || exit 0
       
       Love nodemon? You can now support the project via the open collective:
        > https://opencollective.com/nodemon/donate
       
       
       > sharp@0.24.1 install /tmp/build_83a779a9/node_modules/sharp
       > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
       
       info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.0/libvips-8.9.0-linux-x64.tar.gz
       
       > core-js@2.6.11 postinstall /tmp/build_83a779a9/node_modules/core-js
       > node -e "try{require('./postinstall')}catch(e){}"
       
       
       > pdf-fill-form@5.0.1 install /tmp/build_83a779a9/node_modules/pdf-fill-form
       > node-gyp rebuild
       
       make: Entering directory '/tmp/build_83a779a9/node_modules/pdf-fill-form/build'
         CXX(target) Release/obj.target/pdf_fill_form/src/pdf-fill-form.o
       In file included from ../src/pdf-fill-form.cc:1:
       ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
       ../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
        2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
             |                                                              ^
       In file included from ../../nan/nan.h:56,
                        from ../src/pdf-fill-form.cc:1:
       ../src/pdf-fill-form.cc: At global scope:
       /app/.cache/node-gyp/12.17.0/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
         608 |       (node::addon_register_func) (regfunc),                          \
             |                                           ^
       /app/.cache/node-gyp/12.17.0/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
         642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
             |   ^~~~~~~~~~~~~
       ../src/pdf-fill-form.cc:27:1: note: in expansion of macro ‘NODE_MODULE’
          27 | NODE_MODULE(pdf_fill_form, InitAll)
             | ^~~~~~~~~~~
         CXX(target) Release/obj.target/pdf_fill_form/src/NodePopplerAsync.o
       In file included from ../src/NodePopplerAsync.cc:1:
       ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
       ../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
        2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
             |                                                              ^
         CXX(target) Release/obj.target/pdf_fill_form/src/NodePoppler.o
       In file included from ../src/NodePoppler.cc:1:
       ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
       ../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
        2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
             |                                                              ^
       In file included from /tmp/build_83a779a9/.apt/usr/include/x86_64-linux-gnu/qt5/QtCore/qabstractitemmodel.h:43,
                        from /tmp/build_83a779a9/.apt/usr/include/x86_64-linux-gnu/qt5/QtCore/QAbstractListModel:1,
                        from /tmp/build_83a779a9/.apt/usr/include/poppler/qt5/poppler-optcontent.h:26,
                        from /tmp/build_83a779a9/.apt/usr/include/poppler/qt5/poppler-qt5.h:45,
                        from ../src/NodePoppler.cc:10:
       /tmp/build_83a779a9/.apt/usr/include/x86_64-linux-gnu/qt5/QtCore/qvariant.h: In constructor ‘QVariant::QVariant(QVariant&&)’:
       /tmp/build_83a779a9/.apt/usr/include/x86_64-linux-gnu/qt5/QtCore/qvariant.h:275:25: warning: implicitly-declared ‘constexpr QVariant::Private& QVariant::Private::operator=(const QVariant::Private&)’ is deprecated [-Wdeprecated-copy]
         275 |     { other.d = Private(); }
             |                         ^
       /tmp/build_83a779a9/.apt/usr/include/x86_64-linux-gnu/qt5/QtCore/qvariant.h:401:16: note: because ‘QVariant::Private’ has user-provided ‘QVariant::Private::Private(const QVariant::Private&)’
         401 |         inline Private(const Private &other) Q_DECL_NOTHROW
             |                ^~~~~~~
       ../src/NodePoppler.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE ReadBufferSync(Nan::NAN_METHOD_ARGS_TYPE)’:
       ../src/NodePoppler.cc:539:7: warning: variable ‘n’ set but not used [-Wunused-but-set-variable]
         539 |   int n = 0;
             |       ^
       ../src/NodePoppler.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE ReadSync(Nan::NAN_METHOD_ARGS_TYPE)’:
       ../src/NodePoppler.cc:565:7: warning: variable ‘n’ set but not used [-Wunused-but-set-variable]
         565 |   int n = 0;
             |       ^
         SOLINK_MODULE(target) Release/obj.target/pdf_fill_form.node
       /usr/bin/ld: /tmp/build_83a779a9/.apt/usr/lib/x86_64-linux-gnu/libcairo.a(cairo-boxes.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
       /usr/bin/ld: final link failed: bad value
       collect2: error: ld returned 1 exit status
       make: *** [pdf_fill_form.target.mk:174: Release/obj.target/pdf_fill_form.node] Error 1
       make: Leaving directory '/tmp/build_83a779a9/node_modules/pdf-fill-form/build'
       gyp ERR! build error 
       gyp ERR! stack Error: `make` failed with exit code: 2
       gyp ERR! stack     at ChildProcess.onExit (/tmp/build_83a779a9/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
       gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
       gyp ERR! System Linux 4.4.0-1096-aws
       gyp ERR! command "/tmp/build_83a779a9/.heroku/node/bin/node" "/tmp/build_83a779a9/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
       gyp ERR! cwd /tmp/build_83a779a9/node_modules/pdf-fill-form
       gyp ERR! node -v v12.17.0
       gyp ERR! node-gyp -v v5.1.0
       gyp ERR! not ok 
       npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! pdf-fill-form@5.0.1 install: `node-gyp rebuild`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the pdf-fill-form@5.0.1 install script.
       npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.kWNEy/_logs/2021-10-17T12_58_25_523Z-debug.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

【问题讨论】:

    标签: node.js heroku npm


    【解决方案1】:

    您好,请运行以下命令:

    $ sudo apt-get update
    $ sudo apt-get install build-essential
    

    这个错误是编译你的应用使用其他库引起的,请尝试评论。

    最好的问候!

    【讨论】:

      猜你喜欢
      • 2011-06-10
      • 2013-02-08
      • 1970-01-01
      • 2021-11-16
      • 2020-01-06
      • 2018-11-09
      • 2015-06-05
      • 2012-09-14
      • 2022-01-22
      相关资源
      最近更新 更多