install-subset icon indicating copy to clipboard operation
install-subset copied to clipboard

Choose installer according to lock file

Open rohit-gohri opened this issue 5 years ago • 3 comments

Problem

I have both yarn and npm installed on my system as I contribute to various projects, each of which use different tool sets.

This defaults to yarn is yarn is available, which it is on my system, but I use npm for some projects.

Proposed Solution

Detect installer based on lockfile or add a manual override to specify installer

rohit-gohri avatar Jun 08 '20 06:06 rohit-gohri

Does the --npm option help you?

.option('--npm', 'Use npm to install.')

I think maybe I could make the autodetect a little more elegant. If say a package-lock exists, but no yarn.lock, it should use npm, not yarn as it does now.

tabrindle avatar Jun 08 '20 14:06 tabrindle

--npm does fix it for me. Didn't see it in the docs.

I can open a PR for this if that'd be okay with you?

rohit-gohri avatar Jun 08 '20 15:06 rohit-gohri

Of course! PRs are always welcome.

tabrindle avatar Jun 24 '20 19:06 tabrindle