#Deployment on Railway and Nixpacks Erroring

8 messages · Page 1 of 1 (latest)

fringe juniper
#

Hi im experimenting the following error.

╔══════════════ Nixpacks v1.5.1 ══════════════╗
║ setup      │ nodejs-16_x, npm-8_x           ║
║─────────────────────────────────────────────║
║ install    │ npm i                          ║
║─────────────────────────────────────────────║
║ build      │ npm run build                  ║
║─────────────────────────────────────────────║
║ start      │ npm install --legacy-peer-deps ║
╚═════════════════════════════════════════════╝
 

#11 3.970 npm ERR! code ERESOLVE
#11 3.975 npm ERR! ERESOLVE unable to resolve dependency tree
#11 3.976 npm ERR!
#11 3.976 npm ERR! While resolving: medusa-starter-default@0.0.1
#11 3.976 npm ERR! Found: @medusajs/medusa@1.11.0
#11 3.976 npm ERR! node_modules/@medusajs/medusa
#11 3.976 npm ERR!   @medusajs/medusa@"^1.11.0" from the root project
#11 3.976 npm ERR!
#11 3.976 npm ERR! Could not resolve dependency:
#11 3.977 npm ERR! peer @medusajs/medusa@"1.9.0" from @medusajs/admin@3.0.0
#11 3.977 npm ERR! node_modules/@medusajs/admin
#11 3.977 npm ERR!   @medusajs/admin@"^3.0.0" from the root project
#11 3.977 npm ERR!
 
#11 3.977 npm ERR! Fix the upstream dependency conflict, or retry
#11 3.977 npm ERR! this command with --force, or --legacy-peer-deps
#11 3.977 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
#11 3.977 npm ERR!
#11 3.977 npm ERR! See /root/.npm/eresolve-report.txt for a full report.
#11 3.980
#11 3.980 npm ERR! A complete log of this run can be found in:
#11 3.980 npm ERR!     /root/.npm/_logs/2023-05-24T23_13_49_511Z-debug-0.log
 
#11 ERROR: process "/bin/bash -ol pipefail -c npm i" did not complete successfully: exit code: 1
  
Error: Docker build failed

I don't think i can influence the install command.
Is there a way to fix this?

#

Deployment on Railway and Nixpacks Erroring

fringe juniper
#

Okey so that it helps others

adding a nixpacks.toml
with the following in the root workarounded it

[phases.install]
cmds = ['npm install --legacy-peer-deps']
hollow juniper
#

The answer to your issue is in the error message. You have the latest version of @medusajs/medusa but an older version of @medusajs/admin. This might work by installing the dependencies with the legacy peer deps flag, but it might not as these two versions may be incompatible. What you should do instead is to update your version of admin to the latest.

fringe juniper
hollow juniper
# fringe juniper Thanks Yeah, figured that out, i posted the answer/fix above your comment 🙂

But that is what I am saying is not the proper way to solve this, as you can't be guaranteed that the versions of @medusajs/medusa and @medusajs/admin are compatible. So even if you can force the install with npm install --legacy-peer-deps the admin might break because it is expecting another version of the Medusa API. So the proper fix is to update your version of @medusajs/admin so it matches your version of @medusajs/medusa

#

Since you are on @medusajs/medusa@1.11.0 you should update your version of @medusajs/admin to @5.0.0 as those were part of the same release

fringe juniper