Skip to content

Bug: prisma version --json should suppress dotenv message #25478

@hinaloe

Description

@hinaloe

Bug description

I want to use prisma version information, so I tried to do prisma version --json | jq ... , but I get the following message from dotenv, so I get an error.

Environment variables loaded from .env

This is because printMessage is fixed to true.

await loadEnvFile({ printMessage: true })

How to reproduce

  1. install & make .env file
  2. exec pnpm exec prisma version --json
  3. shown Environment variables loaded from .env message.

Expected behavior

Dont show Environment variables loaded from .env message (or opt-outable)

$ pnpm exec prisma version --json
{
  "prisma": "5.21.1",
  "@prisma/client": "5.21.1",
  "computed-binarytarget": "debian-openssl-3.0.x",
...

Prisma information

empty: This is not related to schema

Environment & setup

  • OS: Arch Linux
  • Database: PostgreSQL
  • Node.js version: v18/v20

Prisma Version

prisma                  : 5.21.1
@prisma/client          : 5.21.1
Computed binaryTarget   : debian-openssl-3.0.x
Operating System        : linux
Architecture            : x64
Node.js                 : v18.19.0
Query Engine (Node-API) : libquery-engine bf0e5e8a04cada8225617067eaa03d041e2bba36 (at node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine           : schema-engine-cli bf0e5e8a04cada8225617067eaa03d041e2bba36 (at node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm             : @prisma/prisma-schema-wasm 5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36
Default Engines Hash    : bf0e5e8a04cada8225617067eaa03d041e2bba36
Studio                  : 0.503.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.size:XSThis PR changes 0-9 lines, ignoring generated files.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions