首先,为了托管目的,我想把我的所有文件都推到heroku,在这里我不能在heroku上安装multer和multer-gridfs-存储的依赖,所以我不能在heroku上托管我的网站。
remote: -----> Installing dependencies
remote: Installing node modules
remote: npm ERR! code ERESOLVE
remote: npm ERR! ERESOLVE could not resolve
remote: npm ERR!
remote: npm ERR! While resolving: multer-gridfs-storage@5.0.2
remote: npm ERR! Found: multer@1.4.5-lts.1
remote: npm ERR! node_modules/multer
remote: npm ERR! multer@"^1.4.5-lts.1" from the root project
remote: npm ERR!
remote: npm ERR! Could not resolve dependency:
remote: npm ERR! peer multer@"^1.4.2" from multer-gridfs-storage@5.0.2
remote: npm ERR! node_modules/multer-gridfs-storage
remote: npm ERR! multer-gridfs-storage@"^5.0.2" from the root project
remote: npm ERR!
remote: npm ERR! Conflicting peer dependency: multer@1.4.4
remote: npm ERR! node_modules/multer
remote: npm ERR! peer multer@"^1.4.2" from multer-gridfs-storage@5.0.2
remote: npm ERR! node_modules/multer-gridfs-storage
remote: npm ERR! multer-gridfs-storage@"^5.0.2" from the root project
remote: npm ERR!
remote: npm ERR! Fix the upstream dependency conflict, or retry
remote: npm ERR! this command with --force, or --legacy-peer-deps
remote: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
remote: npm ERR!
remote: npm ERR! See /tmp/npmcache.fbHb6/eresolve-report.txt for a full report.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.fbHb6/_logs/2022-10-22T21_00_27_665Z-debug-0.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed发布于 2022-10-23 11:46:21
-lts.1在multer@"^1.4.5-lts.1"上的后缀导致它不被来自multer-gridfs-storage@5.0.2的对等版本约束^1.4.2所匹配。根据npm信号计算器的说法,满足这个版本约束的Multer的最新版本是1.4.4。
考虑到似乎是1.x开发行兼容的延续。和穆特存在于国家预防机制生态系统中,我认为这是穆特项目中的一个缺陷。它的版本号应该满足NPM对术语的理解。
最简单的解决方案是将您对Multer的直接依赖从版本^1.4.5-lts.1减少到版本1.4.4,这满足了来自GridFS存储的对等依赖。希望您不依赖于更新版本中的任何特性或bug修复。
我已经提交了一个针对穆特计划的错误,这表明它的LTS版本约束仍然与拼写器兼容,前提是1.4.5-lts.1版本实际上应该与版本1.4.4和更早版本兼容。
我在术语或国家预防机制方面的知识不足,不足以知道这种实施是否实际上是正确的。重要的是,穆特项目和国家预防机制的实施似乎有冲突。
我相信-lts.1后缀被认为是预录 (也就是说,1.4.4-lts.1将出现在1.4.4之前)。符号器计算器似乎是一致的:使用版本约束的>=1.4.2 <=1.4.4-lts.1匹配1.4.2、1.4.3和1.4.4-lts.1,但不匹配1.4.4。
https://stackoverflow.com/questions/74167128
复制相似问题