Skip to content
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

Prisma generate is looking for npm #1058

Open
DrissiReda opened this issue Dec 27, 2024 · 2 comments
Open

Prisma generate is looking for npm #1058

DrissiReda opened this issue Dec 27, 2024 · 2 comments

Comments

@DrissiReda
Copy link

Bug description

I'm trying to package a small Dockerfile and so I don't have node or npm installed, the expectation being that this is supposed to use rust engine prisma instead of node/ts.

How to reproduce

Use my schema.prisma and run prisma generate

You'll get this output

Installing Prisma CLI
An error ocurred while installing the Prisma CLI; npm install log: env: can't execute 'node': No such file or directory

Traceback (most recent call last):
  File "/usr/bin/prisma", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/prisma/cli/cli.py", line 37, in main
    sys.exit(prisma.run(args[1:]))
             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/prisma/cli/prisma.py", line 35, in run
    entrypoint = ensure_cached().entrypoint
                 ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/prisma/cli/prisma.py", line 99, in ensure_cached
    proc.check_returncode()
  File "/usr/lib/python3.12/subprocess.py", line 502, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['/root/.cache/prisma-python/nodeenv/bin/npm', 'install', '[email protected]']' returned non-zero exit status 127.

Is it trying to install the engine? Why the node and not the rust one as outlined in documentation?

Expected behavior

Not to require node/npm binaries.

Prisma information

// prisma/schema.prisma

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-py"
  recursive_type_depth = 5 
}

model CookieConsent {
  id        Int      @id @default(autoincrement())
  accepted  Boolean
  timestamp DateTime @default(now())
}

Environment & setup

  • OS: Debian 12
  • Database: PostgreSQL
  • Python version: 3.12.8
  • Prisma version:
prisma                  : 5.17.0
prisma client python    : 0.15.0
platform                : linux-musl
expected engine version : 393aa359c9ad4a4bb28630fb5613f9c281cde053
installed extras        : []
install path            : /usr/lib/python3.12/site-packages/prisma
binary cache dir        : /root/.cache/prisma-python/binaries/5.17.0/393aa359c9a
@hridayK
Copy link

hridayK commented Dec 30, 2024

Install node version above 18.12.12 or something around that on linux, I followed this guide: Link for Ubuntu. Once that is done, globally install prisma using npm, using the command:
npm install -g prisma.

Once prisma was globally installed, it worked for me to resolve the issue.

@DrissiReda
Copy link
Author

DrissiReda commented Dec 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants