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:
I have tried:
❌ Using pnpm v8 by having this in my package.json:
I actually never used v9.
❌ Using pnpm@latest as so:
This actually resulted in another error saying this format is invalid:
❌ 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:Jump to solution
specifying pnpm v9 or @latest as shown here does work - https://nixpacks.com/docs/providers/node#corepack
3 Replies
Project ID:
31d9b86c-db7f-44b7-8a2b-6d81ce651e2a
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
specifying pnpm v9 or @latest as shown here does work - https://nixpacks.com/docs/providers/node#corepack