R
Railway5mo ago
linear

NextJS Deployment crashing with ERR_PNPM_NO_LOCKFILE

Project ID: 31d9b86c-db7f-44b7-8a2b-6d81ce651e2a Basically the same as https://help.railway.app/questions/deployment-of-next-js-project-has-suddenl-31fd443e and the other ERR_PNPM issue. My project is crashing with:
1.881  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
1.881  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
I have tried: ❌ Using pnpm v8 by having this in my package.json:
"packageManager": "[email protected]"
"packageManager": "[email protected]"
I actually never used v9. ❌ Using pnpm@latest as so:
"packageManager": "pnpm@latest"
"packageManager": "pnpm@latest"
This actually resulted in another error saying this format is invalid:
0.535 Usage Error: Invalid package manager specification in package.json (pnpm@latest); expected a semver version
0.535 Usage Error: Invalid package manager specification in package.json (pnpm@latest); expected a semver version
❌ Trying both the V2 and the Legacy runtime ❌ Deleting/Regenrating node_modules and pnpm-lock.yaml What can I do?
Railway Help Station
Deployment of NextJS project has suddenly started failing - ERR_PNP...
Suddenly, one of my services (a NextJS project) has started failing whenever it is redeployed (due to random updates in my project) What confuses me is that I am getting error 'ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent' even though the project has the pnpm.lock. I have tried rebuilding the file...
Solution:
specifying pnpm v9 or @latest as shown here does work - https://nixpacks.com/docs/providers/node#corepack
Jump to solution
3 Replies
Percy
Percy5mo ago
Project ID: 31d9b86c-db7f-44b7-8a2b-6d81ce651e2a
linear
linearOP5mo ago
Fixed it. Turns out I was using pnpm v9 locally to generate the lockfile and that was the issue. So even though I specified v8 in package.json, the fix was to downgrade my local pnpm to v8 and reinstall all dependencies
Solution
Brody
Brody5mo ago
specifying pnpm v9 or @latest as shown here does work - https://nixpacks.com/docs/providers/node#corepack
Want results from more Discord servers?
Add your server