flyctl deploy --remote-only error

I’ve been trying to deploy my server on fly.io but I get this error while trying to run fly deploy --remote-only

=> ERROR [build 3/4] RUN npm ci                                                                                       0.9s
------                                                                                                                      
 > [build 3/4] RUN npm ci:                                                                                                  
#10 0.900 npm ERR! code ERESOLVE                                                                                            
#10 0.903 npm ERR! ERESOLVE could not resolve                                                                               
#10 0.903 npm ERR!                                                                                                          
#10 0.903 npm ERR! While resolving: mongoose-currency@0.2.0                                                                 
#10 0.903 npm ERR! Found: mongoose@7.3.4
#10 0.903 npm ERR! node_modules/mongoose
#10 0.903 npm ERR!   mongoose@"^7.3.1" from the root project
#10 0.903 npm ERR! 
#10 0.903 npm ERR! Could not resolve dependency:
#10 0.903 npm ERR! peer mongoose@"~> 4.x" from mongoose-currency@0.2.0
#10 0.903 npm ERR! node_modules/mongoose-currency
#10 0.904 npm ERR!   mongoose-currency@"^0.2.0" from the root project
#10 0.904 npm ERR! 
#10 0.904 npm ERR! Conflicting peer dependency: mongoose@4.13.21
#10 0.904 npm ERR! node_modules/mongoose
#10 0.904 npm ERR!   peer mongoose@"~> 4.x" from mongoose-currency@0.2.0
#10 0.904 npm ERR!   node_modules/mongoose-currency
#10 0.904 npm ERR!     mongoose-currency@"^0.2.0" from the root project
#10 0.904 npm ERR! 
#10 0.904 npm ERR! Fix the upstream dependency conflict, or retry
#10 0.904 npm ERR! this command with --force or --legacy-peer-deps
#10 0.904 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
#10 0.904 npm ERR! 
#10 0.904 npm ERR! 
#10 0.904 npm ERR! For a full report see:
#10 0.904 npm ERR! /root/.npm/_logs/2023-07-18T19_26_13_063Z-eresolve-report.txt
#10 0.905 
#10 0.906 npm ERR! A complete log of this run can be found in:
#10 0.906 npm ERR!     /root/.npm/_logs/2023-07-18T19_26_13_063Z-debug-0.log
------
Error: failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c npm ci]: exit code: 1

I’ve tried running the command with --legacy-peer-deps flag as well, but it doesn’t work. Is there a way to fix this. Thanks

Hi,

Looks like a code issue, rather than a Fly-specific one :thinking:. It seems that mongoose-currency has an old dependency, on mongoose 4. There is a pull request to update it but since that was 5 years ago it’s probably safe to assume that’s not going to happen:

It looks like someone has forked mongoose-currency to at least update to use mongoose 5. So you could try using that instead. That may resolve a conflict:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.