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

🐛 Cannot find module '@biomejs/cli-linux-x64/biome' #5109

Closed
1 task done
Th3S4mur41 opened this issue Feb 12, 2025 · 5 comments
Closed
1 task done

🐛 Cannot find module '@biomejs/cli-linux-x64/biome' #5109

Th3S4mur41 opened this issue Feb 12, 2025 · 5 comments
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@Th3S4mur41
Copy link
Contributor

Th3S4mur41 commented Feb 12, 2025

Environment information

## Windows (Dev Machine)

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.11.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.9.0"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

## Linux (Codespace & CI/CD)
CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.14.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.9.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

When a developer working on a Windows machines runs npm install, 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'
  ]
}

A simple test to reproduce:

  1. Close 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 above.

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

Might be related to #4717

Expected result

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

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Th3S4mur41 Th3S4mur41 added the S-Needs triage Status: this issue needs to be triaged label Feb 12, 2025
@ematipico
Copy link
Member

I'm not sure Biome can do something here. Or am I incorrect?

To me, it seems more a package manager inconvenience

@arendjr
Copy link
Contributor

arendjr commented Feb 13, 2025

Agreed, I think this is an NPM shortcoming. IIRC Yarn doesn’t have this issue, probably pnpm doesn’t either.

@arendjr arendjr closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
@Th3S4mur41
Copy link
Contributor Author

Thanks for the feedback, I've opened an issue in npm cli to follow up on this

@Th3S4mur41
Copy link
Contributor Author

Issue seems to be a bug in npm 10

@hoavandoan
Copy link

I also got the same error in my nextjs project when using bun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants