当我将应用程序nodejs切换到heroku时,我得到了问题



sh: 1: node-pre-gyp: Permission deniednpm犯错!代码ELIFECYCLEnpm犯错!errno 126npm犯错!canvas@2.8.0 install: node-pre-gyp install --fallback-to-buildnpm犯错!退出状态126npm犯错!npm犯错!canvas@2.8.0安装脚本失败。npm犯错!这可能不是npm的问题。上面可能有额外的日志输出。

   npm ERR! A complete log of this run can be found in:
   npm ERR!     /tmp/npmcache.eYOj4/_logs/2021-07-23T14_32_47_369Z-debug.log

我找到解决方案了!这里的问题是"node-pre-gyp"无法执行(代码126)你需要安装它:"npm i node-pre-gyp"然后从本地文件夹和github repo中删除node_modules文件夹,并推送代码。然后在herokuapp上构建主分支。它对我有用,我希望它对你也有用。

最新更新