javascript - Heroku 在部署时进行故障排除
问题描述
这是构建日志:
Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 14.x...
Downloading and installing node 14.16.0...
Using default npm version: 6.14.11
-----> Restoring cache
- node_modules is checked into source control and cannot be cached
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> canvas@2.6.1 install /tmp/build_92fcdccd/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.ARucy/_logs/2021-03-16T08_52_45_363Z-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***
我不知道做错了什么。我只是在我的机器人上更改了一些东西,并想将其部署到 heroku 并且发生了这种情况。有人可以帮我吗?
解决方案
推荐阅读
- python - bitrix24 REST API 中的“自定义类型无效”错误
- javascript - 如何将禁用的多选值发送到服务器
- java - 将包 JAR 从 Github URL 下载到 R 包中的 /inst/java
- php - 在 Woocommerce 中的 WordPress 多站点(客户除外)上分配角色
- angularjs - 通过 JS 类销毁的 Fullcalendar 自定义视图会引发错误
- php - 从 ajax 调用中检索值
- c# - 将许多字段传递到聚合管道中的下一阶段
- javascript - 更改其中存在的输入字段的背景颜色后,字段集顶部边框中断:仅在 IE 11 中
- javascript - 如何从javascript函数为gridview文本框分配变量值
- node.js - 如何从 Nodejs 中的不同模式获取数据