Две разные сборки Heroku пытаются собрать один и тот же пакет, но одна из них выдает ошибку. В замешательстве - PullRequest
1 голос
/ 07 мая 2020

Я работаю над двумя разными ботами Discord и развертываю их в двух разных приложениях Heroku, оба приложения находятся в стеке Heroku 18 и имеют одинаковые пакеты сборки, но одно дает мне ошибку. Я использую node.js

Это пакет. json

{
  "name": "amadeus-bot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "author": "Lewd Nyaa",
  "license": "ISC",
  "dependencies": {
    "ascii-table": "0.0.9",
    "cairo": "0.1.0-alpha.2",
    "canvas": "^2.6.1",
    "canvas-constructor": "^3.2.0",
    "common-tags": "^1.8.0",
    "discord.js": "^12.2.0",
    "dotenv": "^8.2.0",
    "dotenv-flow": "^3.1.0",
    "mongoose": "^5.9.10"
  }
}

Это результат сборки для успешной

-----> 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):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 12.x...
       Downloading and installing node 12.16.3...
       Using default npm version: 6.14.4
       
-----> Restoring cache
       - node_modules
       
-----> Installing dependencies
       Installing node modules (package.json)
       audited 234 packages in 1.422s
       
       7 packages are looking for funding
         run `npm fund` for details
       
       found 0 vulnerabilities
       
       
-----> Build
       
-----> Caching build
       - node_modules
       
-----> Pruning devDependencies
       audited 234 packages in 1.526s
       
       7 packages are looking for funding
         run `npm fund` for details
       
       found 0 vulnerabilities
       
       
-----> Build succeeded!
-----> Discovering process types
       Procfile declares types     -> worker
       Default types for buildpack -> web
-----> Compressing...
       Done: 42.1M
-----> Launching...
       Released v64
       https://amadues-nebula-bot.herokuapp.com/ deployed to Heroku

Вот результат сборки для неудачной

-----> 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):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 12.x...
       Downloading and installing node 12.16.3...
       Using default npm version: 6.14.4
       
-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build
       
-----> Installing dependencies
       Installing node modules (package.json)
       
       > canvas@2.6.1 install /tmp/build_252493b633390546ae3f33da2d95a735/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_252493b633390546ae3f33da2d95a735/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
       gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
       gyp ERR! System Linux 4.4.0-1062-aws
       gyp ERR! command "/tmp/build_252493b633390546ae3f33da2d95a735/.heroku/node/bin/node" "/tmp/build_252493b633390546ae3f33da2d95a735/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
       gyp ERR! cwd /tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas
       gyp ERR! node -v v12.16.3
       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_252493b633390546ae3f33da2d95a735/.heroku/node/bin/node /tmp/build_252493b633390546ae3f33da2d95a735/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
       node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
       node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:310: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-1062-aws
       node-pre-gyp ERR! command "/tmp/build_252493b633390546ae3f33da2d95a735/.heroku/node/bin/node" "/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
       node-pre-gyp ERR! cwd /tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas
       node-pre-gyp ERR! node -v v12.16.3
       node-pre-gyp ERR! node-pre-gyp -v v0.11.0
       node-pre-gyp ERR! not ok 
       Failed to execute '/tmp/build_252493b633390546ae3f33da2d95a735/.heroku/node/bin/node /tmp/build_252493b633390546ae3f33da2d95a735/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/tmp/build_252493b633390546ae3f33da2d95a735/node_modules/canvas/build/Release --napi_version=5 --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.b8Gpi/_logs/2020-05-06T20_31_21_781Z-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
       
       Some possible problems:
       
       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

Они оба были развернуты в одно и то же время.

...