Heroku构建无法进行依赖项安装 [英] Heroku build failing on dependency install

查看:83
本文介绍了Heroku构建无法进行依赖项安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使在我自己的PC上运行正常,Node Canvas仍未安装在Heroku构建中.我正在使用nodejs版本12.16.3.我在任何地方都找不到解决方案.

Node Canvas isn't installing on Heroku build, even though it works just fine on my own PC. I'm on nodejs version 12.16.3. I can't find a solution for this anywhere.

画布是必须的,在Heroku之前,我从未见过此错误.这是Heroku的问题还是我的软件包/软件包锁定文件的问题?

Canvas is a must, and I've never seen this error before until Heroku. Is this a problem with Heroku or a problem with my package/package-lock files?

如果您需要,我的Discord是Tom Becker#0590.

My Discord is Tom Becker#0590 in case you need it.

这是我的构建日志:

-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  12.x
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 12.x...
       Downloading and installing node 12.18.1...
       Using default npm version: 6.14.5
       
-----> Installing dependencies
       Installing node modules (package.json + package-lock)
       
       > deasync@0.1.19 install /tmp/build_282e7f55032649968878bcdef8821199/node_modules/deasync
       > node ./build.js
       
       `linux-x64-node-12` exists; testing
       Binary is fine; exiting
       
       > canvas@2.6.1 install /tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas
       > node-pre-gyp install --fallback-to-build
       
       Package pangocairo was not found in the pkg-config search path.
       Perhaps you should add the directory containing `pangocairo.pc'
       to the PKG_CONFIG_PATH environment variable
       No package 'pangocairo' found
       gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
       gyp ERR! configure error 
       gyp ERR! stack Error: `gyp` failed with exit code: 1
       gyp ERR! stack     at ChildProcess.onCpExit (/tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
       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-1073-aws
       gyp ERR! command "/tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/bin/node" "/tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
       gyp ERR! cwd /tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas
       gyp ERR! node -v v12.18.1
       gyp ERR! node-gyp -v v5.1.0
       gyp ERR! not ok 
       node-pre-gyp ERR! build error 
       node-pre-gyp ERR! stack Error: Failed to execute '/tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/bin/node /tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
       node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/tmp/build_282e7f55032649968878bcdef8821199/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
       node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
       node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
       node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
       node-pre-gyp ERR! System Linux 4.4.0-1073-aws
       node-pre-gyp ERR! command "/tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/bin/node" "/tmp/build_282e7f55032649968878bcdef8821199/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
       node-pre-gyp ERR! cwd /tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas
       node-pre-gyp ERR! node -v v12.18.1
       node-pre-gyp ERR! node-pre-gyp -v v0.11.0
       node-pre-gyp ERR! not ok 
       Failed to execute '/tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/bin/node /tmp/build_282e7f55032649968878bcdef8821199/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/tmp/build_282e7f55032649968878bcdef8821199/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
       npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the canvas@2.6.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.3BVoV/_logs/2020-06-26T16_20_37_894Z-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版本工作,对我适用的最新版本是 14.14.0 ,因此请尝试在您的 package.json

Looks like there is some issue with prebuilt packages. It can work depending on Node.js version, latest version which is worked for me is 14.14.0 so try to setup it in your package.json

  • v12.0.x成功
  • v12.16.x失败
  • v12.x.x失败
  • v13.0.x成功
  • v13.3.0成功
  • v13.x.x失败
  • v14.0.x失败
  • v14.1.x失败
  • v14.14.0成功
  • v15.0.1失败

此处的更多信息 https://github.com/Automattic/node-canvas/issues/1563#issuecomment-625149050

在最近的发行版 https://nodejs.org/en/blog/release/v15.0.1/

这篇关于Heroku构建无法进行依赖项安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆