Skip to content

nx:run-commands does not work in interactive CLIs like prisma #27305

Open

Description

Current Behavior

When trying to execute Prisma CLI commands, interactive input cannot be provided. Prisma presents the prompt to input, but nothing can be entered.

For example:

> nx run domain:migrate

> prisma migrate dev

Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database <omitted>

? Enter a name for the new migration: »

I cannot, however, enter said migration name. No keyboard input (except Ctrl+C) works.

Expected Behavior

Entering interactive input is possible as it would be when ran directly (i.e. ./node_modules/.bin/prisma migrate dev or yarn prisma migrate dev)

GitHub Repo

No response

Steps to Reproduce

  1. Setup fresh Nx project (or use nx-examples)
  2. Install Prisma CLI with package manager of choice (i.e. yarn add -D prisma) and init (ex yarn prisma init)
  3. Setup target using nx:run-commands to execute, for example, prisma migrate dev
  4. Run the new target via nx, observe lack of interactivity.

Nx Report

Node           : 20.10.0
OS             : win32-x64
Native Target  : x86_64-windows
yarn           : 4.3.1

nx             : 19.5.5
@nx/js         : 19.5.5
@nx/jest       : 19.5.5
@nx/linter     : 19.5.5
@nx/eslint     : 19.5.5
@nx/workspace  : 19.5.5
@nx/devkit     : 19.5.5
@nx/nest       : 19.5.5
@nx/node       : 19.5.5
@nrwl/tao      : 19.5.5
@nx/web        : 19.5.5
@nx/webpack    : 19.5.5
typescript     : 5.5.4
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I found and read through #8269, which sounds like my issue and was allegedly fixed in #21195, but it doesn't look like that was actually the case.

project.json:

{
  "name": "domain",
  ...
  "targets": {
    "migrate": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "packages/domain",
        "parallel": false,
        "forwardAllArgs": true,
        "command": "prisma migrate dev"
     }
  }
}

prisma/prisma.schema:

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

generator client {
    provider = "prisma-client-js"
}

model Example {
   id Int @id @default(autoincrement())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions