Loading
prisma: fix dangling symlinks
Make sure we don't leave dangling symlinks in `$out` when building `prisma`. 1. We remove the original `node_modules` after buliding the packages to re-install the runtime dependencies without the dev dependencies. The way it was done was incorrect: only the root `node_modules` directory was removed but not the nested ones inside the packages. The follow-up `pnpm install` command didn't re-create or empty them and only created new files within, so we were left with tons of dangling symlinks from the first, full, `pnpm install` invocation. 2. `.pnpm/node_modules` inside the root `node_modules` contains symlinks to each workspace member package. However, we don't copy every package to `$out`, so we need to clean up this directory to remove the references to the missing packages. Fixes: https://github.com/NixOS/nixpkgs/issues/380427