I'd say that you need to persist the package (i.e. pnpm) as volumes, but you need to validate where is pnpm installed within the filesystem of the running pipeline on Cloud Build.
PD: I'm supposing you are installing globally pnpm.