question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make nx run more flexible when using script runner workflow

See original GitHub issue

Current Behavior

After adding Nx to a Lerna repo using add-nx-to-monorepo I’m unable to run any scripts that have a colon in them.

Example:

{
  "name": "packages/my-lib",
  "scripts": {
    "cypress:open": "cypress open ",
    ...
  }
}
nx run packages/my-lib:cypress:open

Expected Behavior

I would expect that I could run the cypress:open script using nx run

Steps to Reproduce

  • Run add-nx-to-monorepo to an existing Lerna workspace
  • Add a script with a colon in a package’s package.json
  • Call that script with a colon using nx run

Failure Logs

When you run the command you get the following error:

NX Cannot find target 'cypress' for project packages/my-lib`

Environment

NX Report complete - copy this into the issue template

Node : 16.13.2 OS : darwin x64 npm : 8.1.2

nx : 14.1.7 @nrwl/angular : Not Found @nrwl/cypress : Not Found @nrwl/detox : Not Found @nrwl/devkit : Not Found @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : Not Found @nrwl/js : Not Found @nrwl/linter : Not Found @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : Not Found @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : Not Found @nrwl/web : Not Found @nrwl/workspace : Not Found typescript : 4.4.4 rxjs : 6.6.7

Community plugins:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jordanpowell88commented, May 19, 2022

@AgentEnder The infix target format works but the quotation marks example does not.

0reactions
AgentEndercommented, Oct 7, 2022

I’m going to close this out now for the following reasons:

  • The documented reasons for failure above (e.g. shell consuming quotes)
  • The infix notation works
  • Transitioning from lerna “just works” with the useNx flag introduced in lerna v5. Folks can continue running their commands with lerna.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying Nx Affected Apps from GitHub Actions - Medium
Having multiple apps in a Nx workspace is common and convenient, but when it's time to deploy the apps it can be difficult...
Read more >
Support for generic task execution, displaying affecting ...
Nx allows you more flexibility with support for adding generic task runners. You can have default options for running tasks, or custom options...
Read more >
Run Tasks | Nx
For more control over the order tasks are executed, edit the Task Pipeline Configuration. To speed up your task execution, learn how to...
Read more >
Teamcenter Rapid Start 11.6 SettingUpWorkflows for Product ...
Handlers are essential to designing flexible, complex workflows. Use action handlers to perform all types of digital actions, such as running scripts, ...
Read more >
Running Jobs - FASRC DOCS
FASRC cluster nodes run the CentOS distribution of the Linux operating system and commands are run under the “bash” shell. As with most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found