Я пытаюсь использовать canvas@2.0.1 для node.js на Heroku и получаю ошибку.Это работает локально, но не на Heroku.У меня есть стандартный Heroku node.js buildpack и https://github.com/mojodna/heroku-buildpack-cairo.git buildpack.Но это не работает в любом случае.Я установил стек Heroku на heroku-16, как в этом уроке https://github.com/Automattic/node-canvas/wiki/Installation:-Heroku.
Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 10.x...
Downloading and installing node 10.15.3...
Using default npm version: 6.4.1
-----> Restoring cache
Caching has been disabled because NODE_MODULES_CACHE=false
-----> Building dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> canvas@2.0.1 install /tmp/build_740f62aeea9de9685056464b73f59756/node_modules/canvas
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! canvas@2.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the canvas@2.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.OP96c/_logs/2019-03-09T06_55_20_142Z-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_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
- 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