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

detect package manager and offer commands using the correct one #215

Open
mnbf9rca opened this issue Jan 3, 2023 · 3 comments
Open

detect package manager and offer commands using the correct one #215

mnbf9rca opened this issue Jan 3, 2023 · 3 comments

Comments

@mnbf9rca
Copy link

mnbf9rca commented Jan 3, 2023

I'm using Yarn, which, since v2, offers yarn dlx as an equivalent of npx. The scripts and VS Code plugin should recognise the package manager in use and format commands to use the correct one.

@motdotla
Copy link
Member

motdotla commented Nov 4, 2023

Not sure how to go about this. @mnbf9rca, any ideas?

@mnbf9rca
Copy link
Author

mnbf9rca commented Nov 4, 2023 via email

@CamilleHbp
Copy link

@motdotla
I know of two ways:

  1. The antfu/ni package does this by checking the lock file's presence (yarn.lock for yarn, pnpm-lock.yaml for pnpm and package-lock.json for npm.)
  2. I created a small task runner that checks the packageManager field in package.json since I am using corepack.

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

No branches or pull requests

3 participants