Our site is failing to deploy PR previews. Specifically, when it runs
yarn to install dependencies, we’re getting this error:
YN0001: Error: While cloning /opt/build/repo/packages/loot-core/node_modules/cross-env → /opt/build/repo/packages/desktop-client/node_modules/cross-env ENOENT: no such file or directory, scandir ‘/opt/build/repo/packages/loot-core/node_modules/cross-env’
This is happening across multiple PRs and seems to have started happening yesterday. Clearing cache and rebuilding seems to generally fix the issue, but future commits to the same branch appear to cause the issue to reoccur.
actualbudget.netlify.app. Example build log: Netlify App
Hi @j-f1 I see you were able to successfully deploy. Are you still experiencing this issue?
Hi @SamO, I’m experiencing the exact same error from a week ago. I would trigger a manual clear cache + deploy and it’d eventually be gone for a while but then it’s coming back randomly. This happens on our apps linked to the same monorepo. The error itself:
6:32:31 PM: ➤ YN0001: │ Error: While cloning /opt/build/repo/apps/move-app-client/node_modules/babel-jest -> /opt/build/repo/apps/app/node_modules/babel-jest ENOENT: no such file or directory, scandir '/opt/build/repo/apps/move-app-client/node_modules/babel-jest'
Hi @sreucherand ,
You may want to check out this support guide: [Support Guide] My site deploy fails unless Netlify's build cache is cleared and see if any of the suggestions help
Do let us know how it goes!
Thank you for getting back to me.
I checked on the points you mentioned. Here is my take on these:
- We did not commit node_modules, we know it is bad practice.
- Our dependencies list may contain binary components. Though we do not update the dependencies so often, a cache clean like I did should have solve the problem but the error keeps coming back.
- I guess there is a mistake in the documentation, it is considered bad practice to have a yarn.lock and package-lock.json together but package.json and yarn.lock are totally fine. And I double checked, we do not mix dependencies manager, we go for yarn only.
- No manipulation of the node_modules directory whatsoever, and since we are not even committing it, I don’t see any impact here.
- We do use yarn workspaces, and we align with your specifications.
- Base directory is properly set.
It looks like we comply to your recommendations. I would add that we are using another CI tool in parallel of Netlify for our tests integration with very aggressive and strict cache policy and we do not experience any similar issues what so ever. So I’d be glad if you could have a look at our failing app deployments.
Could you please share which site is this about?
I could see this happening on pretto-app, pretto-website, pretto-storybook. If you need the attached domains, I could give this information to you in private.
Thank you for sharing these thread, I’m preparing an update of our version of yarn and we’ll see how it behaves. I’ll keep you posted!