Open spicyzboss opened 2 years ago
I'm pretty sure this has something to do with this issue.
Prisma Client Python solved this by showing alternatives to access Prisma Studio, we should probably do something similar.
@Brendonovich For what it's worth I'm looking into an actual fix for this which would be to avoid using the packaged CLI in the first place and instead downloading node at runtime if it isn't already installed on the user's machine.
This is what the CLI workflow with proposed change would look like for Prisma Client Python:
node
/ nodejs-bin
is not installed then download node using nodeenv
nodejs-bin
is a Python package for installing Node binaries into the current Python environment. This would improve the experience for some users as Node would be installed at the same time and to the same location as their other dependencies~/.cache/prisma-binaries/4.0.0/e4567/
if it isn't already installed there.
node node_modules/prisma/build/index.js
From my testing this works perfectly well in the Python Client and has no discernible downsides apart from the fact that there is somewhat of a size increase when it comes to downloading node with nodeenv
, although that can be mitigated by installing nodejs-bin
which ends up being the same size as the packaged CLI. The upside to making this change (apart from fixing this particular bug) is that the Python Client then doesn't have to download the engine binaries and can delegate that to the CLI which will remove a lot of code and maintenance burden.
I don't have enough context about the Rust Client to know if this solution would also work here but I thought it was worth bringing to your attention anyway :)
@RobertCraigie that's an interesting idea. Here in Rust-land I don't know if any package that allows for installing node as a dependency.
I don't like the idea of forcing Rust developers to install node, so I'd probably put it behind a feature flag and require that node is available on the system.
If it works for Python then I'm down to do something similar in Rust, thanks for the idea!
Any updates on this? Would love to have prisma studio work directly with the rust client 😄
Nothing atm, seeing as Rust doesn't have an equivalent of nodeenv
I'm not quite sure how to go about this. I'll do it at some point though.
@Brendonovich i have nodejs in my system. Why this does not work?
@numfin prisma-client-rust-cli
doesn't execute the Prisma CLI via node - it uses the pre-packaged version. Accessing the CLI via npm may work.
I am also getting the same error
@ktisakib Please don't comment on issues like this unless you have additional information, a 👍 react is enough and prevents notifying everyone else who is subscribed to this thread.
if you just want studio to run, run npx prisma studio
as @Brendonovich mentioned
after run
cargo prisma studio
it show me errorThis is my schema.prisma