Open eladcon opened 8 months ago
Wing's ecosystem makes heavy use of peer dependencies. yarn does not have a builtin way to install peer dependencies. In addition to that, the now-default PnP mechanism that yarn uses is likely not something we're going to support anytime soon.
Given that, I don't think yarn is something we will support. npm is the only officially supported package manager for now while pnpm and bun both unofficially work as well.
A workaround if yarn must be used, it must not be with the PnP nodeLinker mode and any peer dependencies must be manually installed. For example, to use @winglibs/cognito
you must run yarn add @winglibs/cognito @cdktf/provider-aws cdktf constructs
To close out this issue we should officially document package manager support level.
Does this issue only surface when installing a @winglib? Or are there issues if I install wing with yarn add (not globally)
In the meantime we might be able to soften the blow of these errors by raise a compiler warning if there's a yarn.lock
or pnpm-lock.yaml
file in the project, e.g.
Warning: We noticed you have a pnpm/yarn/bun lockfile. Wing hasn't been tested with package managers besides npm, so it may be unable to resolve dependencies to Wing libraries when using these tools. See https://github.com/winglang/wing/issues/6129 for more details.
I tried this:
try
@winglibs/cognito
with yarn as the package managerThis happened:
I expected this:
No response
Is there a workaround?
No response
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes