Next.js Discord

Discord Forum

Production build error - ENOENT: no such file or directory

Answered
French Spaniel posted this in #help-forum
Open in Discord
French SpanielOP
[Error: ENOENT: no such file or directory, copyfile '/home/sean/Documents/project/apps/web/node_modules/next/package.json' -> '/home/sean/Documents/project
/apps/web/.next/standalone/node_modules/next/package.json'] {

I am attempting to migrate to a monorepo using turborepo, I am getting the above error when running yarn build to ensure my build is still working. I have rm -rf node_modules and re ran yarn install but to no avail.
Answered by French Spaniel
I’ve got it working, I went to a clean state and deleted all the build outputs, and node modules. Sorry I need to mark this as solved
View full answer

11 Replies

European sprat
have you tried without turborepo?
@European sprat have you tried without turborepo?
French SpanielOP
Tried again without turborepo and got it working, thank you. Something got cached weird in .next, going to setup a cleanup script to ensure I can get back to a clean slate easier
European sprat
i only ever see people saying "don't use turborepo" so i figured it was worth a shot lol
@European sprat i only ever see people saying "don't use turborepo" so i figured it was worth a shot lol
French SpanielOP
oh god, any recommendations for monorepos? I've only ever done multiple repos, but updating my prisma schema across three different repos is getting frustrating
@European sprat i only ever see people saying "don't use turborepo" so i figured it was worth a shot lol
French SpanielOP
The docs have been nothing but confusing for me, I've been copy pasting them into chatgpt lol and having it explain further
European sprat
i don't know anything about monorepos but i've seen others mention yarn (and/or npm?) workspaces
maybe something there to look at
@joulev can you give a minimal reproduction repository? i'm using turborepo in many nextjs apps and it's working smoothly
French SpanielOP
I’ve got it working, I went to a clean state and deleted all the build outputs, and node modules. Sorry I need to mark this as solved
Answer
@joulev can you give a minimal reproduction repository? i'm using turborepo in many nextjs apps and it's working smoothly
French SpanielOP
That’s encouraging to hear, do you know of any examples of turborepo + prisma + docker? I saw the prisma example on turbo repo docs and docker examples but not a combination of the two
@French Spaniel That’s encouraging to hear, do you know of any examples of turborepo + prisma + docker? I saw the prisma example on turbo repo docs and docker examples but not a combination of the two
my apps run turborepo + prisma, but not with docker. idk any examples related to docker because my work doesn't require me to use it