You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
[X] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
I'm using pnpm as package manager and it always worked perfectly in the past. Currently e-square-io/nx-distributed-task fails with the following error:
🏃 Running NX target
/home/runner/setup-pnpm/node_modules/.bin/pnpm exec -p @nrwl/cli nx run-many --projects=markdown --skip-nx-cache=false --target=test --parallel=3
undefined
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL not found: -p
Error: Error: The process '/home/runner/setup-pnpm/node_modules/.bin/pnpm' failed with exit code 1
The command also fails locally, as "pnpm exec" doesn't have a flag -p. (https://pnpm.io/cli/exec)
// this fails
$ pnpm exec -p @nrwl/cli nx run-many ---projects=markdown --target=test --parallel=3
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL not found: -p
// this works
$ pnpm exec nx run-many --projects=markdown --target=test --parallel=3
> NX Running target test for 1 project
Last known version that worked without any issues: v2.2.6. In this version, the run-many command was different: /home/runner/setup-pnpm/node_modules/.bin/nx run-many --projects=markdown --target=test --parallel --maxParallel=3
Expected behavior
It should continue to work with pnpm.
Minimal reproduction of the problem with instructions
Create a github action on a repository and install pnpm:
Thank you for reporting the issue, would you like to contribute and fix it?
It should be pretty easy, the changes are only in nx-distributed-file/src/app/nx.ts file in nxCommand method
the extra -p @nrwl/cli arguments should move to be part of the command if the package manager is npm.
It should be checked what is the equivalent for each package manager
extra info:
the actions uses getPackageManagerCommand from NX to retrieve the commands for the relevant package manager.
for npm its npx
for yarn its yarn
and for pnpm its pnpx and above v6.13 its pnpm exec
Apparently NX is not checking if yarn 2 is being used which doesn't have the list command (it uses a different info command) so we'll need to add a check for yarn's version and to adjust the command accordingly.
Also, what about asserting that NX is installed? does this step works as expected? I assume so as your error is after this step but just to make sure.
ronnetzer
changed the title
Not working anymore with pnpm
[BUG] Running NX command is not working with pnpm
Mar 15, 2022
The assertNxInstalled did work because it was hardcoded to use npm instead of pnpm, but it seems you fixed that today to use the installed package manager instead.
Also, it seems that the actual equivalent of npx -p @nrwl/cli is pnpm --package @nrwl/cli dlx. Should we go down that road or stay close to what nx is returning in getPackageManagerCommand ?
I'm submitting a...
Current behavior
I'm using pnpm as package manager and it always worked perfectly in the past. Currently
e-square-io/nx-distributed-task
fails with the following error:The command also fails locally, as "pnpm exec" doesn't have a flag -p. (https://pnpm.io/cli/exec)
Last known version that worked without any issues: v2.2.6. In this version, the run-many command was different:
/home/runner/setup-pnpm/node_modules/.bin/nx run-many --projects=markdown --target=test --parallel --maxParallel=3
Expected behavior
It should continue to work with pnpm.
Minimal reproduction of the problem with instructions
Create a github action on a repository and install pnpm:
Use the latest version of
e-square-io/nx-distributed-task
to execute the tasks.Environment
The text was updated successfully, but these errors were encountered: