Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Yarn Berry installation error with mozjpeg on Linux #6242

Open
1 task done
ronparkdev opened this issue Apr 22, 2024 · 0 comments
Open
1 task done

[Bug?]: Yarn Berry installation error with mozjpeg on Linux #6242

ronparkdev opened this issue Apr 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ronparkdev
Copy link

ronparkdev commented Apr 22, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

Libraries that require installation located in .yarn/unplugged/, such as the mozjpeg, optipng-bin, and cwebp-bin libraries, causing install to fail.
However, the strange thing is that it works fine on macos, but fails on ubuntu.
To summarize, it seems that require is not working properly in the case of using the ubuntu environment and the experimental loader API.

To reproduce

Steps to Reproduce

  1. Create a package.json file with the following content:
{
  "name": "test",
  "packageManager": "yarn@4.1.1",
  "dependencies": {
    "mozjpeg": "^8.0.0"
  }
}
  1. Run the following command:
yarn install

Expected Behavior

Yarn should successfully install the mozjpeg package.

Actual Behavior

Yarn fails with the following error:

➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ mozjpeg@npm:8.0.0 must be built because it never has been before or the last one failed
➤ YN0009: │ mozjpeg@npm:8.0.0 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-bb95cc93/build.log)
➤ YN0000: └ Completed in 0s 308ms
➤ YN0000: · Failed with errors in 0s 454ms

The error log contains the following message:

# This file contains the result of Yarn building a package (mozjpeg@npm:8.0.0)
# Script name: postinstall

node:internal/modules/cjs/loader:1143
 const err = new Error(message);
       ^

Error: Cannot find module 'decompress'
Require stack:
- /home1/runner/.yarn/berry/cache/bin-build-npm-3.0.0-41c58b5458-10c0.zip/node_modules/bin-build/index.js
Require stack:
- /home1/runner/.yarn/berry/cache/bin-build-npm-3.0.0-41c58b5458-10c0.zip/node_modules/bin-build/index.js
  at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
  at require$$0.Module._resolveFilename (/home1/runner/_work/test/.pnp.cjs:7119:54)
  at Module._load (node:internal/modules/cjs/loader:984:27)
  at require$$0.Module._load (/home1/runner/_work/test/.pnp.cjs:7033:31)
  at Module.require (node:internal/modules/cjs/loader:1231:19)
  at require (node:internal/modules/helpers:179:18)
  at Object.<anonymous> (/home1/runner/.yarn/berry/cache/bin-build-npm-3.0.0-41c58b5458-10c0.zip/node_modules/bin-build/index.js:2:20)
  at Module._compile (node:internal/modules/cjs/loader:1369:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
  at require$$0.Module._extensions..js (/home1/runner/_work/test/.pnp.cjs:7185:33) {
 code: 'MODULE_NOT_FOUND'
}

Node.js v20.12.2
graph TD
A["mozjpeg@8.0.0(in unplugged)"] --"OK"--> B["bin-build@3.0.0(in cache)"]
B  --"failed to resolve"--> C["decompress(in cache)"]

Environment

System:
  OS: Linux 4.19 Ubuntu 20.04.6 LTS (Focal Fossa)
  CPU: (48) x64 Intel(R) Xeon(R) Silver 4214 CPU @ 2.20GHz
Binaries:
  Node: 20.12.2 - /tmp/xfs-da51de7b/node
  Yarn: 4.1.1 - /tmp/xfs-da51de7b/yarn
  npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm

Additional context

No response

@ronparkdev ronparkdev added the bug Something isn't working label Apr 22, 2024
@ronparkdev ronparkdev changed the title [Bug?]: Yarn Berry installation error with mozjpeg on Ubuntu [Bug?]: Yarn Berry installation error with mozjpeg on Linux Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant