Open ShukantPal opened 1 year ago
Transfered this feature request to stackblitz/webcontainer-core
for the WebContainer's team consideration.
Note that while we don't support global package installs at this point, and we may choose to not support them (because every instance of a WebContainers-based project has a new environment, so reloading the page would lose your globally installed packages…), there are a few workarounds:
devDependencies
. That might be the best practice to follow if you want your project to be usable by others (or in CI) without extra manual setup steps.npx
or pnpm dlx
.Thanks @fvsch.
Unfortunately, adding Rush to devDependencies
won’t work because my install script requires Rush to be pre-installed. Rush is a monorepo manager that does package linking/setup.
As I see it, StackBlitz can’t be used for developing on monorepos?
As I see it, StackBlitz can’t be used for developing on monorepos?
I don't think that's a fair representation. The majority of monorepo tooling doesn't require global installs, as far as I know. But yes, when it comes to Rush, unless their specific workarounds for CI and other environments that don’t support global installs work on StackBlitz, then this tool might not be supported on StackBlitz currently.
Yep, I run into this trying that workaround.
pnpm dlx @microsoft/rush
runs into the same issue.
Perhaps there’s something in the StackBlitz environment that makes Rush incompatible, apart from global installations not being available.
Thanks for your input on this.
Hi @ShukantPal ! Thanks for opening this ticket!
Currently we don't allow installing packages globally because of permissions. It also doesn't make a lot of sense because every time you refresh the project, the global packages are gone.
However you are not the first to have run into this issue and we are considering our options to make sure we have a good story for global packages.
I also noticed, from one of your screenshot, that you faced another issue where it says Unable to calculate start time for current process
.
I believe this is caused by some os
APIs missing. Those should be coming very soon™ :smiley:
Is your feature request related to a problem? Please describe.
I am trying to setup github.com/ShukantPal/pixi-essentials in StackBlitz. However, to do so I need a global installation of @microsoft/rush which is not possible in StackBlitz.
Describe the solution you'd like
Support global packages in the WebContainer