pnpm not being used in application build
vcevce
PRO
7 months ago
I have a pnpm workspace monorepo, which I have added to railway via github with a root directory selected. It fails to build and additionally, does not use pnpm…
Is there a correct way to build a project within a pnpm workspace monorepo?
#4 [stage-0 2/10] WORKDIR /app/
#4 CACHED
#5 [internal] load .dockerignore
#5 transferring context: 2B done
#5 DONE 0.0s
#6 [internal] load build context
#6 transferring context: 8.99kB done
#6 DONE 0.0s
#7 [stage-0 3/9] COPY .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix
#7 CACHED
#8 [stage-0 4/9] RUN nix-env -if .nixpacks/nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix && nix-collect-garbage -d
#8 CACHED
#9 [stage-0 5/9] COPY . /app/.
#9 CACHED
#10 [stage-0 6/9] RUN --mount=type=cache,id=s/ba595ab7-288c-4d27-93a2-3f6304a2ce11-/root/npm,target=/root/.npm npm install -g corepack@0.24.1 && corepack enable
#10 0.220 npm warn config production Use `--omit=dev` instead.
#10 0.640
#10 0.640 changed 1 package in 454ms
#10 DONE 0.8s
#11 [stage-0 7/9] RUN --mount=type=cache,id=s/ba595ab7-288c-4d27-93a2-3f6304a2ce11-/root/npm,target=/root/.npm npm i
#11 0.243 npm warn config production Use `--omit=dev` instead.
#11 0.870 npm error code EUNSUPPORTEDPROTOCOL
#11 0.870 npm error Unsupported URL Type "workspace:": workspace:*
#11 0.872 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-19T06_58_43_278Z-debug-0.log
#11 ERROR: process "/bin/bash -ol pipefail -c npm i" did not complete successfully: exit code: 1
-----
> [stage-0 7/9] RUN --mount=type=cache,id=s/ba595ab7-288c-4d27-93a2-3f6304a2ce11-/root/npm,target=/root/.npm npm i:
0.243 npm warn config production Use `--omit=dev` instead.
0.870 npm error code EUNSUPPORTEDPROTOCOL
0.870 npm error Unsupported URL Type "workspace:": workspace:*
0.872 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-19T06_58_43_278Z-debug-0.log
-----
Dockerfile:21
-------------------
19 | COPY . /app/.
20 | RUN --mount=type=cache,id=s/ba595ab7-288c-4d27-93a2-3f6304a2ce11-/root/npm,target=/root/.npm npm install -g corepack@0.24.1 && corepack enable
21 | >>> RUN --mount=type=cache,id=s/ba595ab7-288c-4d27-93a2-3f6304a2ce11-/root/npm,target=/root/.npm npm i
22 |
23 | # build phase
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm i" did not complete successfully: exit code: 1
Error: Docker build failed
ⓘ Deployment information is only viewable by project members and Railway employees.
1 Replies
unicodeveloper
PRO
7 months ago
Hi there, shared monorepos should not have a root directory set. Simply use the root of the app as the root directory and specify install, build and start commands via nixpacks environment variables
Status changed to Awaiting User Response Railway • 8 months ago