This line of code is supposed to find package root, it works when I install ts-jest using yarn or npm but doesn't when I use pnpm.
Unlike npm and yarn, pnpm wants to save disk space by symlinking packages from node_modules/.registry.npmjs.org to node_modules. This makes package root not ../../ relative to ts-jest but ../../../../ relative to ts-jest causing it to print warnings.
Suggestion
Instead of just assuming package root to be in ../../, search for package root in every ancestor directory starting with ../.
...
BTW, I have a package that lists all ancestor directories.
This line of code is supposed to find package root, it works when I install
ts-jestusingyarnornpmbut doesn't when I usepnpm.Unlike
npmandyarn,pnpmwants to save disk space by symlinking packages fromnode_modules/.registry.npmjs.orgtonode_modules. This makes package root not../../relative tots-jestbut../../../../relative tots-jestcausing it to print warnings.Suggestion
Instead of just assuming package root to be in
../../, search for package root in every ancestor directory starting with../....
BTW, I have a package that lists all ancestor directories.