run-many appends a "--" argument when invoking packages' scripts
See original GitHub issueCurrent Behavior
In a monorepo where each package has a tsc
script to run the Typescript checker, when I run tsc
through Nx using this command:
nx run-many --target=tsc --all --skip-nx-cache
Nx appends --
when it invokes the scripts, and that results in the following error:
> nx-bug@1.0.0 tsc /Users/pepicrft/Downloads/nx-bug
> nx run-many --target=tsc --all --skip-nx-cache
✖ nx run project:tsc
> project@1.0.0 tsc /Users/pepicrft/Downloads/nx-bug/packages/project
> tsc -p './tsconfig.json' "--"
error TS5023: Unknown compiler option '--'.
Expected Behavior
I’d expect Nx to invoke the script as it is declared in the package
without appending additional arguments.
Steps to Reproduce
- Download this project nx-bug.zip
- Install dependencies
pnpm install
. - Run
pnpm run tsc
Failure Logs
The code is included above
Environment
Node : 16.13.2
OS : darwin arm64
pnpm : 7.0.0
nx : 14.0.5
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 14.0.5
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 14.0.5
@nrwl/js : Not Found
@nrwl/linter : 14.0.5
@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 : 14.0.5
typescript : 4.6.4
rxjs : 6.6.7
---------------------------------------
Community plugins:
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How can I run multiple npm scripts in parallel? - Stack Overflow
Use a package called concurrently. npm i concurrently --save-dev. Then setup your npm run dev task as so: "dev": "concurrently --kill-others \"npm run ......
Read more >Handling Command-line Arguments in NPM Scripts
The -- notation tells your script to pass the parameters to the current command invoked by NPM. From the NPM docs: "NPM will...
Read more >Parallelising Jobs with GNU Parallel - RONIN BLOG
This means that you can run multiple commands or scripts simultaneously, completing many jobs in the same time it takes to run one....
Read more >Processing Linux Commands in Parallel | Baeldung on Linux
First, let's create a simple script that we'll run in parallel. ... We specify the number of arguments per call using the -n...
Read more >package manual page - Tcl Built-In Commands
If the script argument is omitted, the current script for version version of ... when the command is invoked during a package require...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I worked around it by simply adding an
&& echo
to the end of my tsc commands… ie:"build": "node scripts/build.js && tsc --declaration --emitDeclarationOnly && echo"
@melMass I just created a PR to fix this, so maybe you can hold on for a little longer. 😃