-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find package root when ts-jest is symlinked instead of being installed #823
Comments
That is a bug I was waiting for someone to report... I meant, I have it in mind, but never got the time to report neither fix.
Actually, not only. I meant, it's a bit more complex. For example in monorepo using yarn workspaces, the package.json of the related project (not the root one) is in |
I think there're a few solutions to this:
|
Best solution so far. When we cannot find the package.json, show a warning which explains about this config. There is also a node package which allow to find that package.json, I can't remember its name, but I do remember it is written in the readme that it does not find it in 100% of the cases, even tho it's not just a lookup in parents |
Very interesting discussion here highlighting the nuances of the config lookup. I wonder if the problem can be simplified by introducing some assumptions here. For example, according to TypeScript's documentation, tsconfig.json marks the root of a TypeScript project:
With the root of the project found, the |
Updates loading of package.json to allow specifying of file location or entire contents in addition to existing behavior.
Document the package.json config option.
Document the package.json config option.
I see the fix is merged, but the docs are not showing the changes yet... |
This appears to have a fix in but the issue is still open. Did this fix actually resolve the issue for others? |
The fix adds a
In my project, I added this to my
|
Closed as already provided a way to config path to package.json |
I'm still getting the warning, does anybody has an idea why? |
Hi @elliottsj , the Any ideas on this? CC @ahnpnl |
it is removed in v27 |
Hi @ahnpnl , do you have any idea about how to get rid of this warning in v27?
|
if you use |
This line of code is supposed to find package root, it works when I install
ts-jest
usingyarn
ornpm
but doesn't when I usepnpm
.Unlike
npm
andyarn
,pnpm
wants to save disk space by symlinking packages fromnode_modules/.registry.npmjs.org
tonode_modules
. This makes package root not../../
relative tots-jest
but../../../../
relative tots-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.The text was updated successfully, but these errors were encountered: