Corepack / packageManager / package.json / Root Directory misconfig

Hey all, posting about this issue and a workaround for those encountering something similar.

I’m using Corepack - Configuring a Build. I followed the directions with the Vercel envvar setup, and I have a packageManager property in my package.json. I am not using a package.json in the root of my repository, but instead at the root of my Vercel-configured Root Directory (which makes sense for a monorepo).

Based on what I’ve seen and tried so far, Vercel Build step looks specifically for package.json in the root of the repository and not in the Root Directory, even if no package.json exists in the root of the repository. This seems like an oversight to me – shouldn’t we be looking for a package.json in the Vercel-configured Root Directory?

1 Like

I have a ticket open with Vercel Support, and we identified that the setting “Include files outside the root directory in the Build Step” was causing this. I still think there is an issue with a sane default of what to look for, but turning that off did resolve the issue.

1 Like

Thank you for coming back to share what worked for you. This is super helpful!

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