nx: Regression: --verbose being passed to executors can break commands

Current Behavior

Due to this PR (https://github.com/nrwl/nx/pull/6593), Nx now passes the verbose flag to executors. In the case of the @nrwl/workspace:run-commands executor, this causes --verbose=false to be appended to commands, even when not manually specified. However, if the command that’s being run does not support that flag, and does not silently ignore unknown flags, then that command will fail. In my case I am running npx prisma generate via this executor, which means the command ended up being npx prisma generate --verbose=false; the Prisma CLI does not support this flag or unknown flags, and so fails.

Expected Behavior

--verbose should only be passed to executors if manually specified (as --verbose, --verbose=false, etc)

Steps to Reproduce

Add the following target to any project in an Nx 12.6.4 workspace, and then try to execute it (via nx run <target>:generate):

"generate": {
  "builder": "@nrwl/workspace:run-commands",
  "options": {
    "commands": [
      "npx prisma generate"
    ]
  }
}

Environment

  Node : 16.4.2
  OS   : win32 x64
  npm  : 7.18.1

  nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 12.6.4
  @nrwl/cypress : Not Found
  @nrwl/devkit : 12.6.3
  @nrwl/eslint-plugin-nx : 12.6.4
  @nrwl/express : Not Found
  @nrwl/jest : 12.6.4
  @nrwl/linter : 12.6.3
  @nrwl/nest : 12.6.4
  @nrwl/next : Not Found
  @nrwl/node : 12.6.4
  @nrwl/nx-cloud : 12.3.5
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.6.4
  @nrwl/web : Not Found
  @nrwl/workspace : 12.6.4
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.3.5

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I am on 12.6.6 and it works for me

12.6.5 does not contain this fix yet. It should be in the next patch.

This also started happening here after upgrading from 12.6.3 to 12.6.4:

In 12.6.3: image

In 12.6.4: image

"generate": {
  "builder": "@nrwl/workspace:run-commands",
  "options": {
    "commands": [
      {
        "command": "npx prisma generate",
        "forwardAllArgs": false
      }
    ]
  }
}

This works for me