首页 > 解决方案 > 在 Heroku 上部署不和谐机器人时出现推送错误

问题描述

有人可以帮我吗?

我对编程知之甚少,但我还是设法为服务器创建了一个 Discord 机器人。最初,它运行良好,但有一天当我对机器人进行任何更改时,我无法再将它部署到 Heroku 上。

这是错误消息

$ git push heroku master
Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.
Delta compression using up to 4 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 1.75 KiB | 895.00 KiB/s, done.
Total 19 (delta 14), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Resolving node version 12.x...
remote:        Downloading and installing node 12.19.0...
remote:        Using default npm version: 6.14.8
remote:
remote: -----> Restoring cache
remote:        Cached directories were not restored due to a change in version of node, npm, yarn or stack
remote:        Module installation may take longer for this build
remote:
remote: -----> Installing dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:
remote:        > node-cron@2.0.3 postinstall /tmp/build_d666c44d/node_modules/node-cron
remote:        > opencollective-postinstall
remote:
remote:        sh: 1: opencollective-postinstall: Permission denied
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 126
remote:        npm ERR! node-cron@2.0.3 postinstall: `opencollective-postinstall`
remote:        npm ERR! Exit status 126
remote:        npm ERR!
remote:        npm ERR! Failed at the node-cron@2.0.3 postinstall script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.Miyop/_logs/2020-11-16T21_23_56_325Z-debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - node_modules checked into source control
remote:          https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
remote:
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to gale-explorer.
remote:
To https://git.heroku.com/gale-explorer.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/gale-explorer.git'

任何人都可以帮助我详细的分步程序吗?非常感谢你。

标签: herokudeploymentdiscordbotspush

解决方案


推荐阅读