Turborepo + Vercel + Github Actions: ENOENT: no such file or directory

We are getting this issue:
[Error: ENOENT: no such file or directory, lstat ‘/node_modules/.pnpm/styled-jsx@5.1.1_react@18.3.1/node_modules/styled-jsx/index.js’] {
errno: -2,
code: ‘ENOENT’,
syscall: ‘lstat’,
path: ‘/node_modules/.pnpm/styled-jsx@5.1.1_react@18.3.1/node_modules/styled-jsx/index.js’
}
In turborepo setup, basically this works when using one job but when using a seperate build and deploy job in github actions passing .vercel and .next from build to deploy we get this issue

This error means it can’t find the file, and most likely it means it can’t find any node_modules

If you are passing .vercel and .next to the deploy layer, you’ll need to either

  • install modules in the deploy layer
  • or pass node_modules from build into the deploy layer

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.