[英]HEROKU : node-pre-gyp install --fallback-to-build
I had this problem since I used @discordjs/opus, I saw a big bunch of similar problems everywhere, and nothing helped me changing this error.自从我使用 @discordjs/opus 以来,我遇到了这个问题,我到处都看到了一大堆类似的问题,但没有任何帮助我改变这个错误。 It always concern node-pre-gyp.它总是关注节点预gyp。 I first tried to put it manually in my package.json, and the build suceeded, but there was no sound siplayed, and a lot of warning messages in the build log... Also some people had issues with bcrypt, but it wasn't the case here...我首先尝试将它手动放入我的 package.json 中,并且构建成功,但是没有声音播放,并且构建日志中有很多警告消息......还有一些人对 bcrypt 有问题,但它不是'这里的情况...
Thanks for your help!谢谢你的帮助!
-----> 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`
Well, as JM-AGMS said, the solution was to make visible package lock, type the node engine in the package, and remove the node modules folder in order to have a succeeded build.好吧,正如 JM-AGMS 所说,解决方案是使包锁定可见,在包中键入节点引擎,并删除节点模块文件夹,以便成功构建。
However, the error about node pre-gyp is still there.但是node pre-gyp的错误依旧存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.