自从我使用@discordjs/opus以来,我就遇到了这个问题,我看到到处都是类似的问题,没有什么能帮助我改变这个错误。它总是与node-pre-gyp有关。我首先尝试将它手动放到我的package.json中,构建成功了,但是没有声音播放,并且在构建日志中有很多警告消息……还有一些人对bcrypt有问题,但这里不是这样的。
谢谢你的帮忙!
-----> 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.4...
Using default npm version: 6.14.6
-----> 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
> @discordjs/opus@0.3.2 install /tmp/build_2510a47a_/node_modules/@discordjs/opus
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @discordjs/opus@0.3.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the @discordjs/opus@0.3.2 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.N30Iz/_logs/2020-09-28T09_36_00_646Z-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`发布于 2020-09-30 04:44:57
正如JM-AGMS所说,解决方案是使包锁可见,在包中键入节点引擎,然后删除节点模块文件夹,以获得成功的构建。
但是,关于节点前gyp的错误仍然存在。
https://stackoverflow.com/questions/64099693
复制相似问题