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] Cannot find module '@biomejs/cli-linux-x64/biome' #8106

Closed
2 tasks done
Th3S4mur41 opened this issue Feb 13, 2025 · 2 comments
Closed
2 tasks done

[BUG] Cannot find module '@biomejs/cli-linux-x64/biome' #8106

Th3S4mur41 opened this issue Feb 13, 2025 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@Th3S4mur41
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

When a developer working on a Windows machines runs npm install in a repository with biome as a dependency, linux related optional biome packages are removed from the package-lock.json.

As a result, running npm ci followed by biome ci . in a Linux based CI environment fails with the following error:

Error: Cannot find module '@biomejs/cli-linux-x64/biome'
Require stack:
- /__w/playground/playground/node_modules/@biomejs/biome/bin/biome
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.resolve (node:internal/modules/helpers:146:19)
    at Object.<anonymous> (/__w/playground/playground/node_modules/@biomejs/biome/bin/biome:51:11)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:[32](https://github.com/eviden-parallel/playground/actions/runs/13288940530/job/37106201809?pr=1721#step:6:33))
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/__w/playground/playground/node_modules/@biomejs/biome/bin/biome'
  ]
}

Expected Behavior

The package-lock should remain identical, regardless on what OS npm install is executed.
Otherwise this is creating conflicts between different OS environments.

According to Biome developers, this seems to be an NPM issue, since the problem is not reproducible with Yearn

Steps To Reproduce

  1. Clone a repository on Windows
  2. run npm i @biomejs/biome (in a DOS or Powershell console)
  3. Commit the changes including the package-lock.json
  4. Clone the repository on Linux
  5. run npm i
  6. run npm biome rage => The command will fail with the error below:
Error: Cannot find module '@biomejs/cli-linux-x64/biome'
Require stack:
- /__w/playground/playground/node_modules/@biomejs/biome/bin/biome
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.resolve (node:internal/modules/helpers:146:19)
    at Object.<anonymous> (/__w/playground/playground/node_modules/@biomejs/biome/bin/biome:51:11)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:[32](https://github.com/eviden-parallel/playground/actions/runs/13288940530/job/37106201809?pr=1721#step:6:33))
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/__w/playground/playground/node_modules/@biomejs/biome/bin/biome'
  ]
}

Solving the issue on linux requires removing node_modules and package-lock.json and running npm i again.

Environment

Windows (Dev machine)

node: v22.14.0
npm: 10.9.2
OS: Windows 11 Pro 24H4 26100.3194
Model: Surface Pro 7+ with Core i7

Linux (Codespace and CI)

node: v22.14.0
npm: 10.9.2
OS: Ubuntu 24.04
Model: VM / Docker

@Th3S4mur41 Th3S4mur41 added Bug thing that needs fixing Needs Triage needs review for next steps labels Feb 13, 2025
@milaninfy
Copy link
Contributor

This appears to duplicate if not similer of #7961 If you believe your instance is unique, please provide further clarifying details.

@jsolly
Copy link

jsolly commented Mar 6, 2025

For anyone running into this issue, this is my workaround for GitHub Actions. I am using the new arm GitHub runner, runs-on: ubuntu-24.04-arm

      - name: Install dependencies
        run: npm install
      - name: WORKAROUND (Install biome manually)
        run: npm install --no-save @biomejs/cli-linux-arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

3 participants