berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: Required package missing from disk when using pnp with canary yarn

Open simPod opened this issue 3 years ago • 0 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

I tried running canary (4.0.0-rc.13)

and getting

/builds/projects/project1/124325/.pnp.cjs:31452
  return Object.defineProperties(new Error(message), {
                                 ^
Error: Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.
Missing package: prettier@npm:2.7.1

Expected package location: /root/.yarn/berry/cache/prettier-npm-2.7.1-d1f40f5e1a-9.zip/node_modules/prettier/
    at makeError (/builds/projects/project1/124325/.pnp.cjs:31452:34)
    at resolveUnqualified (/builds/projects/project1/124325/.pnp.cjs:32441:17)
    at resolveRequest (/builds/projects/project1/124325/.pnp.cjs:32464:14)
    at Object.resolveRequest (/builds/projects/project1/124325/.pnp.cjs:32520:26)
    at resolve$1 (file:///builds/projects/project1/124325/.pnp.loader.mjs:221:25)
    at ESMLoader.resolve (node:internal/modules/esm/loader:604:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
    at ESMLoader.import (node:internal/modules/esm/loader:[40](https://gitlab.domain.sth/path/project1/-/jobs/1349330#L40)4:22)
    at node:internal/modules/run_main:54:28
    at loadESM (node:internal/process/esm_loader:85:11)

when trying to run any binary via yarn

To reproduce

I fail to reproduce it locally on

  System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.0.0 - /private/var/folders/11/2hy99kxj3tz2gtv5khgnt2y80000gn/T/xfs-f4972595/node
    Yarn: 4.0.0-rc.13 - /private/var/folders/11/2hy99kxj3tz2gtv5khgnt2y80000gn/T/xfs-f4972595/yarn
    npm: 8.6.0 - /opt/homebrew/bin/npm

This is the command sequence I'm trying

	yarn cache clean --all
	yarn install --immutable
	yarn bin // this outputs binaries like prettier properly

but then trying to run

yarn run prettier --list-different "**/*.{graphql,json,md,yml,yaml}"

gives the error above

Environment

  System:
    OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (40) x64 Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
  Binaries:
    Node: 17.9.0 - /tmp/xfs-1be9c540/node
    Yarn: 4.0.0-rc.13 - /tmp/xfs-1be9c540/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v17.9.0/bin/npm
  System:
    OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (40) x64 Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
  Binaries:
    Node: 18.6.0 - /tmp/xfs-a0a6cc2b/node
    Yarn: 4.0.0-rc.13 - /tmp/xfs-a0a6cc2b/yarn
    npm: 8.13.2 - ~/.nvm/versions/node/v18.6.0/bin/npm

simPod avatar Jul 21 '22 08:07 simPod