yarnpkg / berry

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

[Bug?]: YN0001: TypeError: Cannot destructure property 'deprecated' of 'fe.versions[ue]' as it is undefined. #6301

Open artola opened 1 month ago

artola commented 1 month ago

Self-service

Describe the bug

On CI this error happens from time to time.

YN0001: TypeError: Cannot destructure property 'deprecated' of 'fe.versions[ue]' as it is undefined.
  at /agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:680:5858 at Object.ol (/agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:140:53068)
  at /agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:680:5822 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async Promise.all (index 1252) at async /agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:680:5683
  at async fA.start (/agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:199:6859)
  at async q0.execute (/agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:680:5456) at async q0.validateAndExecute (/agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:94:787)
  at async as.run (/agent/_work/1/s/.yarn/releases/yarn-4.2.2.cjs:98:3250)

➤ Errors happened when preparing the environment required to run this command.
➤ This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.

The error points to: https://github.com/yarnpkg/berry/blob/bfa6489467e0e11ee87268e01e38e4f7e8d4d4b0/packages/plugin-npm-cli/sources/commands/npm/audit.ts#L140

To reproduce

yarn npm audit --all --recursive

Environment

System:
    OS: linux
    CPU: 
  Binaries:
    Node: 20.13.1
    Yarn: 4.2.2

Additional context

I do not know why the error happens sometimes, while most of the time works fine (race condition?). Not reproducible on local machine.