-
-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Labels
Description
Currently, Encore always assumes yarn is used to add packages (with inconsistencies when the error does not come from Encore itself, see #57).
This causes confusion for users using npm instead of yarn (see #287).
When starting to work on Encore, yarn was considered superior to npm, because we compared it to version 3. With the version 5 of npm, the difference between both is smaller, so we should try to respect choices of the user.
Here is my proposal:
- if the project contains a
yarn.lockfile, display theyarncommand to the user - if the project contains a
packages.lockfile, display thenpmcommand to the user - otherwise, display the
yarncommand (following our existing rule where we favor yarn)
The last point may be changed in the future once geowarin/friendly-errors-webpack-plugin#33 gets resolved, to fix #57 (if they display the yarn version only when having a yarn.lock file, we may want to do the same, as running Yarn without lock file is not recommended anyway)
Lyrkan