-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Nestia can not properly find @nestia/sdk in Yarn Monorepos #251
Comments
OK, I'll patch it after home. |
package.json also exists in |
Updated the example layout. But yes, there is always a package.json in the root path. At least with yarn and pnpm. |
Okay, I will wait for |
There you go. Installed nestia manually with ttsc. https://github.com/Aderinom/yarn-monorepo-example When I tried to use the nestia setup yesterday, that also ran into some issues, don't remember what though. |
I'll try it, thx. |
Oh my god, I found that I have to check both of them. |
I'm not sure. But I think that require would actually try all node_modules in all parent folders. |
https://www.typescriptlang.org/docs/handbook/module-resolution.html https://nodejs.org/api/modules.html#loading-from-node_modules-folders |
Fix #251 - support yarn monorepo in setup wizard
Update to the latest, then be fixed. |
Bug Report
Summary
Nestia can not find it's packages when beeing used in a yarn monorepo
npx nestia swagger "src/**/*.controller.ts" --out ./
should output a swagger.json
@nestia/sdk has not been installed. Run "npx nestia setup" before.
Nestia tries to find its packages by using a fully qualified path:
await import(process.cwd() + "/node_modules/@nestia/sdk"); index.ts:53
This does not work as expected in yarn monorepos and will probably also cause issues with
repos using pnpm.
Yarn saves all packages from child workspaces in the root node_modules. (hoisting)
As such the fully qualified path supplied will not be able to find the packages.
Example format of yarn monorepo
The text was updated successfully, but these errors were encountered: