2 years ago
Hi, i'm trying to run the B2B template from here (https://github.com/medusajs/b2b-starter-medusa), but i'm getting:
#10 [stage-0 6/10] RUN --mount=type=cache,id=s/7ccf675d-cbf9-4463-8502-b321da1cb537-/root/npm,target=/root/.npm yarn installPackage.json
{
"name": "my-monorepo",
"private": true,
"scripts": {
"setup": "yarn build-packages && yarn setup-db && yarn seed && yarn setup-user",
"dev": "turbo run dev",
"build-packages": "turbo run build --filter ./packages/*",
"setup-db": "cd ./apps/backend && npx medusa db:create && npx medusa db:migrate",
"seed": "turbo run seed --filter=medusa-starter-default",
"setup-user": "cd ./apps/backend && npx medusa user -e admin@test.com -p supersecret -i admin",
"generate-env": "cp ./apps/backend/.env.template ./apps/backend/.env && cp ./apps/storefront/.env.template ./apps/storefront/.env",
"start": "turbo run start",
"lint": "turbo run lint"
},
"packageManager": "yarn@4.5.0",
"devDependencies": {
"turbo": "latest",
"typescript": "latest"
},
"workspaces": [
"apps/*",
"packages/*"
],
"engines": {
"node": ">=20",
"yarn": ">=1.22"
}
}
And i even added railway.json file:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn setup",
"nixpacksPlan": {
"phases": {
"install": {
"dependsOn": ["setup"],
"cmds": ["yarn install"]
}
}
}
},
"deploy": {
"startCommand": "yarn start",
"numReplicas": 1,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}Any ideas?
37 Replies
2 years ago
hello, thats not a project id
2 years ago
yep
I ejected the project to my repo https://github.com/kompraventa/b2b-starter-medusa
2 years ago
did the template work before you ejected?
Actually yes, i'll resolve the issue. I'm getting "could not find task start" but that's another issue

On forked/ejected untouched repo i'm getting now
#11 1.732 ➤ YN0000: │ "@algolia/cache-browser-local-storage@npm:4.24.0":
#11 1.732 ➤ YN0000: │ version: 4.24.0
#11 1.732 ➤ YN0000: │ resolution: "@algolia/cache-browser-local-storage@npm:4.24.0"
#11 1.732 ➤ YN0000: │
#11 1.732 ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
#11 1.732 ➤ YN0000: └ Completed
#11 1.732 ➤ YN0000: · Failed with errors in 0s 761ms
#11 ERROR: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1
-----
> [stage-0 7/9] RUN --mount=type=cache,id=s/2f921a83-4d00-453d-9890-f9671610ffd0-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile:2 years ago
can you link to the template please
This is a new project id where build passes but seems there's problem with turbo
aba163f0-3827-4fcb-8b18-23cc52b795432 years ago
^
Sorry, this? https://github.com/kompraventa/b2b-template
2 years ago
the railway template
I'm not using a template, i was looking at this https://railway.app/template/gkU-27 but now i want to make similar setup but for B2B store, this template is for normal B2C
2 years ago
you said ejected, that terminology is specific to when you had deployed from a template
Yes, but i created a brand new project from a forked repo (named b2b-template)
I'm not sure why previous one didn't work, it was an eject from template, and this one is a github fork
2 years ago
what template
2 years ago
what you have in your project is not what the template is
This project
9858f6a2-8b94-41a0-8b1d-d60480e7ce45Was created from template
But this one
aba163f0-3827-4fcb-8b18-23cc52b79543Was created from scratch, i created an empty project and connected it to the forked repo (https://github.com/kompraventa/b2b-template)
2 years ago
have you tried setting the root directory's
I didn't try, not sure what to put there since instructions from origin repo (https://github.com/medusajs/b2b-starter-medusa?tab=readme-ov-file#quickstart) says to run
yarn install && yarn setupFrom root. Now if i set root dir it won't work, i assume. This command runs both backend and storefront (frontend), port 9000 and 8000 respectively.
2 years ago
the template you linked has root directories set
Yes but the creator made it custom irrelevant from B2B case, they only have backend and frontend dirs in the root, it's not a monorepo
2 years ago
what command starts just the backend server?
2 years ago
you do not want to be using cd
2 years ago
you need a command that starts the backend
2 years ago
same for the frontend service
2 years ago
once you have those, set them on the service settings
In the root of monorepo in its package.json there's
"start": "turbo run start"Which runs start on both backend and frontend somehow, unfortunately my knowledge on turbo is limited, i'm not sure how it does that
2 years ago
you need a command that only runs the backend