yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.47k stars 1.12k forks source link

[Feature] Verbose flag for installation #6556

Open cawolfdev opened 1 month ago

cawolfdev commented 1 month ago

Describe the user story

As a developer, I would like to know why yarn install fails.

NPM: repository installs without error, on all environments Yarn 1: repository installs without error, on all environments. Yarn 3.5: Local machine, repository installs without error Yarn 3.5: Different machine, repository installs without error Yarn 3.5: Jenkins server: repository fails to install.

There is no way to debug what is failing or why.

It would be useful to know what yarn is attemping to do when it errors, or locks up.

Logs printed to the console:

2024-10-11T00:49:46.202Z] + yarn install --frozen-lockfile

[2024-10-11T00:49:47.706Z] ➤ YN0050: The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead

[2024-10-11T00:49:47.706Z] ➤ YN0000: ┌ Resolution step

[2024-10-11T00:49:48.669Z] ➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.74.83 doesn't provide @babel/preset-env (p8ed8f), requested by @react-native/codegen

[2024-10-11T00:49:48.669Z] ➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.74.85 doesn't provide @babel/preset-env (pc2337), requested by @react-native/codegen

[2024-10-11T00:49:48.669Z] ➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (p62fa5), requested by @babel/plugin-syntax-flow

[2024-10-11T00:49:48.670Z] ➤ YN0000: └ Completed in 0s 679ms

[2024-10-11T00:49:48.670Z] ➤ YN0000: ┌ Fetch step

[2024-10-11T01:17:30.880Z] Sending interrupt signal to process

[2024-10-11T01:17:42.052Z] Terminated

[2024-10-11T01:17:42.191Z] script returned exit code 143

[Pipeline] }

Yarn 3.5 simply stops for 27 minutes. Doing, as far as I can tell -- absolutely nothing.

Describe the solution you'd like

To have clear information about what yarn install is doing, so that when it fails on CI, it can be diagnosed. To have similar debugging issues as yarn 1, or npm for when yarn install fails to install anything.

Implement a new config option --verbose, or respect a flag such as YARN_LOG_LEVEL to control verbosity.

Describe the drawbacks of your solution

None.

Describe alternatives you've considered

No documentation as to how to hook into the installation process in order to output logs.