Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js HEROKU:节点预gyp安装--回退到构建_Node.js_Heroku_Discord.js - Fatal编程技术网

Node.js HEROKU:节点预gyp安装--回退到构建

Node.js HEROKU:节点预gyp安装--回退到构建,node.js,heroku,discord.js,Node.js,Heroku,Discord.js,自从我使用@discordjs/opus之后,我就遇到了这个问题,我到处都看到了大量类似的问题,没有任何东西能帮我改变这个错误。它总是与gyp前的节点有关。我首先尝试手动将其放入我的package.json中,构建成功,但没有声音显示,构建日志中有很多警告消息。。。还有一些人对bcrypt有意见,但这里的情况并非如此 谢谢你的帮助 -----> Creating runtime environment NPM_CONFIG_LOGLEVEL=e

自从我使用@discordjs/opus之后,我就遇到了这个问题,我到处都看到了大量类似的问题,没有任何东西能帮我改变这个错误。它总是与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`

正如JM-AGMS所说,解决方案是设置可见的包锁,在包中键入节点引擎,然后删除节点模块文件夹,以便成功构建


但是,关于node pre gyp的错误仍然存在。

正如JM-AGMS所说,解决方案是设置可见的包锁,在包中键入节点引擎,然后删除node modules文件夹,以便成功构建


但是,关于node pre gyp的错误仍然存在。

编辑:构建可以在我的计算机上正常工作,声音也可以播放。最后,我忽略了Heroku的node modules文件夹和package-lock.json。请尝试在package.json中设置npm和node版本,以便Heroku使用您计算机上的内容。顺便说一句,您需要将package-lock.json部署到Heroku。编辑:该构建在我的计算机上运行良好,声音也可以播放。最后,我忽略了Heroku的节点模块文件夹和package-lock.json。请尝试在package.json中设置npm和节点版本,以便Heroku使用您计算机上的内容。顺便说一句,您需要将package-lock.json部署到Heroku。很高兴它成功了。尝试仅在package.json上将节点版本降级为
10.13.0
,这似乎可以解决某些人的问题。很高兴它成功了。尝试仅在package.json上将节点版本降级为
10.13.0
,这似乎可以解决某些人的问题。