"ENOENT: no such file or directory in monorepo with yarn workspaces

Viewed 2051

I have two repositories which independent (not in a monorepo) work like a charm (building & testing). However, as soon as I place them in a monorepo with yarn workspaces it doesn't work any more.

Let me explain: I have an angular and a node/typescript repository. Inside the Monorepo, when I run yarn test, the tests inside my node/typescript project still work, but the angular ones give Schema validation failed with the following errors:

enter image description here

So, as we know with yarn workspaces all node_modules are hoisted to the root, so I decided to turn hoisting off

...
"workspaces": {
    "packages": [
        "packages/*"
    ],
    "nohoist": [
        "**/ui",
        "**/ui/**",
        "**/core",
        "**/core/**"
    ]
},
...

I removed all node_modules and tried to run yarn again. However, this time the installation of packages already fails with the following message:

error An unexpected error occurred: "ENOENT: no such file or directory, lstat....rimraf

enter image description here

I found this open issue which is probably the same, but does not provide a workaround. So if someone knows a way to workaround this I would really like to know?! Cheers

For more details you can checkout the repo here

0 Answers
Related