Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a -c option in the pnpm dlx command #5679

Closed
steveluscher opened this issue Nov 24, 2022 · 4 comments · Fixed by #5840
Closed

Support a -c option in the pnpm dlx command #5679

steveluscher opened this issue Nov 24, 2022 · 4 comments · Fixed by #5840
Milestone

Comments

@steveluscher
Copy link

pnpm version: 7.17.0

Code to reproduce the issue:

pnpx --package lolcatjs --package cowsay -c \
  'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs'

Expected behavior:

Should install packages and call command.

Actual behavior:

$ pnpx -p lolcatjs -p cowsay -c \
>            'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs'
/home/.local/share/pnpm/store/v3/tmp/dlx-1174922:
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/-p: Not Found - 404

This error happened while installing a direct dependency of /home/.local/share/pnpm/store/v3/tmp/dlx-1174922

-p is not in the npm registry, or you have no permission to fetch it.

An authorization header was used: Bearer npm_[hidden]

Additional information:

  • node -v prints: v16.18.1
  • Windows, macOS, or Linux?: Linux
@steveluscher
Copy link
Author

Notably, npx works using these same options.

@zkochan
Copy link
Member

zkochan commented Dec 13, 2022

You can use the --package option with pnpm dlx:

 pnpm --package cowsay --package lolcatjs dlx cowsay hi

But -c is not supported currently.

@steveluscher
Copy link
Author

Yeah! That's basically what's at issue here. Would you like me to change the title of this issue to ‘implement -c option in pnpx for parity with npx’?

@zkochan zkochan changed the title --package option yields error Support a -c option in the pnpm dlx command Dec 13, 2022
@await-ovo
Copy link
Member

should we add the -shell-mode(shorthands: -c) option to pnpm dlx ?, just like pnpm exec, This should do the same thing as npm --call:

pd --package cowsay --package lolcatjs -c dlx 'echo "hi" | cowsay | lolcatjs'

If this is possible, I would be happy to send a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants