R
Railway2y ago
Chen

how do i update pnpm in nixpack before installing?

I'm trying to do npm i -g pnpm, but railway seems to be automatically detecting my pnpm-lock and is just doing pnpm install before those build scripts.
13 Replies
Percy
Percy2y ago
Project ID: N/A
Chen
ChenOP2y ago
N/A 7c98ae62-dafb-4aad-82bc-463906350ad9
Brody
Brody2y ago
install before build is how it's supposed to work ??
Chen
ChenOP2y ago
usually i would include "npm i -g pnpm; pnpm install" in my build script ie. render.com or, there would be a dedicated "install" script, ie. vercle but in this case it seems that the install script is automatically detected, so i can't update pnpm before then and it errors out
Brody
Brody2y ago
show me the error please
Chen
ChenOP2y ago
[stage-0 6/10] RUN --mount=type=cache,id=s/ce8b2188-8081-4b6f-a77e-eebbf311358f-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile:
#10 5.581 Your pnpm version is incompatible with "/app". #10 5.581 #10 5.581 Expected version: >=8.6.3 #10 5.581 Got: 7.33.3 #10 5.581 #10 5.581 This is happening because the package's manifest has an engines.pnpm field specified. #10 5.581 To fix this issue, install the required pnpm version globally. #10 5.581 #10 5.581 To install the latest version of pnpm, run "pnpm i -g pnpm".  #10 5.581 To check your pnpm version, run "pnpm -v". ----- Dockerfile:20 ------------------- 18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH 19 | COPY . /app/. 20 | >>> RUN --mount=type=cache,id=s/ce8b2188-8081-4b6f-a77e-eebbf311358f-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile 21 | 22 | # build phase ------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1  Error: Docker build failed
Brody
Brody2y ago
you need pnpm v8 right?
Chen
ChenOP2y ago
yes!
Brody
Brody2y ago
nixpacks doesn't have support for pnpm v8 yet I have put in a request myself, so in the mean time, you may want to move to a Dockerfile based build
Chen
ChenOP2y ago
i see, ok! thank u
Brody
Brody2y ago
I'm sure there's plenty of examples for that online
Chen
ChenOP2y ago
the dockerfile worked well :) thanks!
Brody
Brody2y ago
well that was fast, happy you got it working!
Want results from more Discord servers?
Add your server