Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Buffalo new does not support Yarn 2+ (berry) #95

Closed
saurori opened this issue Jan 2, 2022 · 5 comments · Fixed by #96
Closed

Buffalo new does not support Yarn 2+ (berry) #95

saurori opened this issue Jan 2, 2022 · 5 comments · Fixed by #96
Assignees
Labels
enhancement New feature or request

Comments

@saurori
Copy link
Contributor

saurori commented Jan 2, 2022

Description

Running buffalo new on a system with Yarn version 2+ (berry) fails with:

DEBU[2022-01-02T11:43:45-05:00] Exec: yarnpkg install --no-progress --save
DEBU[2022-01-02T11:43:45-05:00] Unknown Syntax Error: Unsupported option name ("--no-progress").

Solution

Yarn 1.x (classic) may support the --no-progress option but it is not present in the docs. There is a --silent option that also works with Yarn 2+.

I suggest the option is changed, and also Buffalo switches the default to install yarn@berry when yarnpkg is not found. I will make a PR for this.

Info

go version go1.17.5 darwin/arm64
Buffalo (CLI), v0.18.1
Yarn version 2.4.3
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@saurori
Copy link
Contributor Author

saurori commented Feb 2, 2022

Commenting to remove stale, PR open.

@sio4
Copy link
Member

sio4 commented Feb 25, 2022

Hi, sorry for the delay. I am working on this since yesterday. Actually, I was not aware of the new version and I am on some research about it since I want to prevent user confusion if it could introduce some issue. Reviewing the PR, it seems like it will just affect newly generated apps but please let me double-check about it.

Meanwhile, it seems like the option --silent is not the same as --no-progress. [1] While --no-progress which was introduced by PR [2] in 2016 just suppresses the on-screen progress bar and prints other information, --silent which was introduced by PR [3] in 2017 suppresses all output after finishing its job but still shows the progress bar during running. With this behavior, I prefer seeing that information and wanted find what was the reason we used --no-progress option here. (Actually, the only different I can see now is very small)

Also, the berry get back the option --slient by PR [4] in last year, so I also want to check if there is any plan to get back --no-progress too, also want to consider which option or removing all option could be better for buffalo users.

Anyway, I would like to add +1 to support berry since it seems like it resolved many issues in the classic version.

Thanks!

[1]

$ rm -rf node_modules/
$ yarn install
yarn install v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 7.32s.
$ rm -rf node_modules/
$ yarn install --no-progress
yarn install v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 6.48s.
$ rm -rf node_modules/
$ yarn install --silent
$ 

[2] yarnpkg/yarn#1190
[3] yarnpkg/yarn#2420
[4] yarnpkg/berry#3542

@sio4 sio4 self-assigned this Feb 25, 2022
@sio4 sio4 added the enhancement New feature or request label Feb 25, 2022
@sio4
Copy link
Member

sio4 commented Feb 26, 2022

Some findings:

  1. make sure yarn uses --no-progress buffalo#554 is the PR that added the yarn option to buffalo cli and has no linked issue. I could not find any user issue related to this option. --> I guess removing the --no-progress option will not be a big deal.
  2. With your PRed branch, the buffalo new app command generated more than 4k lines (including blank lines that may be added by buffalo cli)
  3. Most of those lines are something like ➤ YN0013: │ @babel/generator@npm:7.17.3 can't be found in the cache and will be fetched from the remote registry, not directly related to the progress bar option
  4. berry has closed issue [Feature] add less verbose output yarnpkg/berry#816 which pointing https://yarnpkg.com/configuration/yarnrc#logFilters
  5. It seems like logFilters works fine for this issue.
$ yarnpkg install --silent |tee |wc -l 
2640
$ rm -rf  .yarn/cache .yarn/install-state.gz .yarn/unplugged/ .pnp.* yarn.lock
$ cat >> .yarnrc.yml <<EOF
> logFilters:
>   - code: YN0013
>     level: discard
> EOF
$ yarnpkg install --silent |tee |wc -l 
10
$ 

IMO, we need to handle the verbose output properly if we introduce this change.
Including this, I am adding some comments on the PR.

@sio4 sio4 linked a pull request Mar 11, 2022 that will close this issue
@sio4
Copy link
Member

sio4 commented Mar 12, 2022

PR was merged into the development branch. Closing.

@sio4 sio4 closed this as completed Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants