yarnpkg / berry

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

[Bug?]: Github master branch installation fails #5465

Open Sogl opened 1 year ago

Sogl commented 1 year ago

Self-service

Describe the bug

  1. Trying to install lightGallery with latest master commit: yarn add lightGallery@github:sachinchoolur/lightGallery -D
  2. It fails:
    laradock@3edd7fd0dc0c:/var/www/sogl$ yarn add lightGallery@github:sachinchoolur/lightGallery -D
    ➤ YN0000: ┌ Resolution step
    ➤ YN0013: │ lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3 can't be found in the cache 
    ➤ YN0013: │ lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3 can't be found in the cache 
    ➤ YN0058: │ lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3: Packing the package failed (exit code 1, logs can be found here: /tmp/xfs-30de49a1/pack.log)
    ➤ YN0000: └ Completed in 10m 7s
    ➤ YN0000: Failed with errors in 10m 7s

Also add commant don't support --verbose option...

My Macbook is warming up a lot during the process.

To reproduce

await packageJsonAndInstall({
  devDependencies: {
    [`lightGallery`]: `github:sachinchoolur/lightGallery`
  }
});

await expect(output).not.toThrow(`Failed with errors`);

Environment

Laradock Docker container

 System:
    OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 17.8.0 - /tmp/xfs-b6b31f72/node
    Yarn: 3.5.1 - /tmp/xfs-b6b31f72/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v17.8.0/bin/npm

Additional context

Log file. I don't know why it uses Yarn v1 instead of installed v3.

Full output is here: https://gist.githubusercontent.com/Sogl/1070fd08d1966dc8751bb779ebc0428e/raw/97955bc4675160d227d87bbbbed4240184b49bb4/pack.log

yarnbot commented 1 year ago

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js install

➤ YN0000: ┌ Resolution step
::group::Resolution step
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT Packing lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3 from sources
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT Using Yarn Classic for bootstrap. Reason: "__metadata" key not found in yarn.lock, must be a Yarn classic lockfile
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT 
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT ➤ YN0000: Downloading https://classic.yarnpkg.com/latest.js
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT ➤ YN0000: Saving the new release in .yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT ➤ YN0000: Done in 0s 979ms
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT 
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT yarn install v1.22.19
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning package.json: License should be a valid SPDX license expression
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning lightgallery@2.7.1: License should be a valid SPDX license expression
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT [1/5] Validating package.json...
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning lightgallery@2.7.1: License should be a valid SPDX license expression
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT [2/5] Resolving packages...
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning semantic-release > @semantic-release/npm > npm > @npmcli/ci-detect@1.4.0: this package has been deprecated, use `ci-info` instead
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning semantic-release > @semantic-release/npm > npm > npm-registry-fetch > @npmcli/ci-detect@1.4.0: this package has been deprecated, use `ci-info` instead
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning semantic-release > @semantic-release/npm > npm > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR warning semantic-release > @semantic-release/npm > npm > @npmcli/arborist > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT [3/5] Fetching packages...
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT [4/5] Linking dependencies...
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT [5/5] Building fresh packages...
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR error An unexpected error occurred: "/tmp/xfs-9e2a5bd4/node_modules/core-js: Cannot find module 'pnpapi'
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR Require stack:
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR - /tmp/xfs-9e2a5bd4/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR Require stack:
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR - /tmp/xfs-9e2a5bd4/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR Require stack:
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR - /tmp/xfs-9e2a5bd4/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR Require stack:
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR - /tmp/xfs-9e2a5bd4/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR Require stack:
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDERR - /tmp/xfs-9e2a5bd4/.yarn/releases/yarn-classic.cjs".
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT info If you think this is a bug, please open a bug report with the information provided in "/tmp/xfs-9e2a5bd4/yarn-error.log".
➤ YN0000: │ /tmp/xfs-9e2a5bd4 STDOUT info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT Packing lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3 from sources
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT Using Yarn Classic for bootstrap. Reason: "__metadata" key not found in yarn.lock, must be a Yarn classic lockfile
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT 
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT ➤ YN0000: Downloading https://classic.yarnpkg.com/latest.js
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT ➤ YN0000: Saving the new release in .yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT ➤ YN0000: Done in 0s 410ms
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT 
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT yarn install v1.22.19
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning package.json: License should be a valid SPDX license expression
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning lightgallery@2.7.1: License should be a valid SPDX license expression
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT [1/5] Validating package.json...
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning lightgallery@2.7.1: License should be a valid SPDX license expression
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT [2/5] Resolving packages...
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning semantic-release > @semantic-release/npm > npm > @npmcli/ci-detect@1.4.0: this package has been deprecated, use `ci-info` instead
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning semantic-release > @semantic-release/npm > npm > npm-registry-fetch > @npmcli/ci-detect@1.4.0: this package has been deprecated, use `ci-info` instead
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning semantic-release > @semantic-release/npm > npm > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
➤ YN0000: │ /tmp/xfs-28f8051a STDERR warning semantic-release > @semantic-release/npm > npm > @npmcli/arborist > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT [3/5] Fetching packages...
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT [4/5] Linking dependencies...
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT [5/5] Building fresh packages...
➤ YN0000: │ /tmp/xfs-28f8051a STDERR error An unexpected error occurred: "/tmp/xfs-28f8051a/node_modules/core-js-pure: Cannot find module 'pnpapi'
➤ YN0000: │ /tmp/xfs-28f8051a STDERR Require stack:
➤ YN0000: │ /tmp/xfs-28f8051a STDERR - /tmp/xfs-28f8051a/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-28f8051a STDERR Require stack:
➤ YN0000: │ /tmp/xfs-28f8051a STDERR - /tmp/xfs-28f8051a/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-28f8051a STDERR Require stack:
➤ YN0000: │ /tmp/xfs-28f8051a STDERR - /tmp/xfs-28f8051a/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-28f8051a STDERR Require stack:
➤ YN0000: │ /tmp/xfs-28f8051a STDERR - /tmp/xfs-28f8051a/.yarn/releases/yarn-classic.cjs
➤ YN0000: │ /tmp/xfs-28f8051a STDERR Require stack:
➤ YN0000: │ /tmp/xfs-28f8051a STDERR - /tmp/xfs-28f8051a/.yarn/releases/yarn-classic.cjs".
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT info If you think this is a bug, please open a bug report with the information provided in "/tmp/xfs-28f8051a/yarn-error.log".
➤ YN0000: │ /tmp/xfs-28f8051a STDOUT info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
➤ YN0058: │ lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3: Packing the package failed (exit code 1, logs can be found here: /tmp/xfs-ac844322/pack.log)
::endgroup::
➤ YN0058: lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=f691d0096a4ee00641e1a3be22d4101e715f3ff3: Packing the package failed (exit code 1, logs can be found here: /tmp/xfs-ac844322/pack.log)
➤ YN0000: └ Completed in 2m 15s
➤ YN0000: Failed with errors in 2m 15s

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

Et7f3 commented 10 months ago

The released yarn 4.0.2 doesn't have this issue:

yarn add lightGallery@github:sachinchoolur/lightGallery -D
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + lightGallery@https://github.com/sachinchoolur/lightGallery.git#commit=78c3005b643e9f1a84540459df1ac5a8f229d645, @babel/runtime@npm:7.23.8, @iarna/cli@npm:2.1.0, @types/picturefill@npm:3.0.4, @videojs/http-streaming@npm:2.16.2, @videojs/vhs-utils@npm:3.0.5, @videojs/xhr@npm:2.6.0, and 321 more.
➤ YN0000: └ Completed in 22s 516ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ monaco-editor is listed by your project with version 0.24.0, which doesn't satisfy what @monaco-editor/react (p2acd3) and other dependencies request (^0.25.0).
➤ YN0060: │ react-select is listed by your project with version 5.1.0, which doesn't satisfy what react-select-virtualized (p88a8a) requests (^5.7.0).
➤ YN0060: │ typescript is listed by your project with version 5.3.0-beta, which doesn't satisfy what typedoc (p64163) requests (~4.6.0 || ~4.7.0 || ~4.8.0 || ~4.9.0 || ~5.0.0 || ~5.1.0 || ~5.2.0).
➤ YN0002: │ @yarnpkg/monorepo@workspace:. doesn't provide react-dom (pf5b86), requested by lightGallery.
➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 328 packages were added to the project (+ 21.95 MiB).
➤ YN0000: └ Completed in 2s 24ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0005: │ core-js-pure@npm:3.25.1 lists build scripts, but its build has been explicitly disabled through configuration.
➤ YN0005: │ core-js@npm:3.25.1 lists build scripts, but its build has been explicitly disabled through configuration.
➤ YN0007: │ esbuild@npm:0.15.11 must be built because it never has been before or the last one failed
➤ YN0007: │ keytar@npm:7.9.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 2s 270ms
➤ YN0000: · Done with warnings in 27s 130ms

Just do yarn set version 4.0.2

Even the version checked in the repo (yarn 4.0.2-dev). I also cleaned cache folder ~/.cache/yarn without noticing issue.