如何解决如何在heroku上运行节点画布?
我用node.js创建了一个不和谐的机器人,它使用一个名为canvas的npm运行2.6.1版,但是当我不打算将文件推送到github并进行部署时,我总是遇到错误。如果有帮助,我将运行一个buildpack,这是默认的node.js。
我尝试过使用一个可在此处找到的buildpack:https://github.com/Automattic/node-canvas/wiki/Installation:-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.18.3
Using default npm version: 6.14.6
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> canvas@2.6.1 install /tmp/build_3c59f676_/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.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
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.AGHnL/_logs/2020-08-11T12_04_57_845Z-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://devcenter.heroku.com/articles/node-best-practices#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
任何原因以及如何解决此问题?我已经为此奋斗了大约一个小时左右。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。