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

[Help] Error: Cannot find package 'once' when running download_bun script on Windows #1580

Open
lulkebit opened this issue Mar 11, 2025 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@lulkebit
Copy link

When running bun run download_bun on Windows, the script fails with the following error:

$ bun run ./scripts/download_bun.ts
error: Cannot find package 'once' from 'C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\pump\index.js'

Bun v1.2.5 (Windows x64)
error: script "download_bun" exited with code 1

Environment

  • OS: Windows 11
  • Bun version: 1.2.5 (Windows x64)

Steps to Reproduce

  1. Clone the repository
  2. Run bun run download_bun

Expected Behavior

The script should download and extract the Bun binary as specified in the scripts/download_bun.ts file.

Actual Behavior

The script fails with an error indicating that the 'once' package cannot be found. This package is a dependency of the 'extract-zip' package used in the script.

Possible Cause

The 'once' package is a transitive dependency of 'extract-zip' (version ^2.0.1) which is listed in the devDependencies of the project. It appears that this dependency is not being properly installed or resolved on Windows.

@lulkebit lulkebit added the help wanted Extra attention is needed label Mar 11, 2025
@Kitenite
Copy link
Contributor

This is strange, other Windows developers haven't ran into this issue (neither have I when testing on Windows).
Could you try bun run clean or deleting the node_modules and bun i again?

@lulkebit
Copy link
Author

lulkebit commented Mar 12, 2025

@Kitenite now I run into a different error even after deleting the whole repo and installing it again. I also tried deleting the bun.lock and bun.lockb files but this issue still occurs

$ bun i
bun install v1.2.5 (013fdddc)
  ⚙️  electron [1/5] node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module 'graceful-fs'
Require stack:
- C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\node_modules\fs-extra\lib\fs\index.js
- C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\node_modules\fs-extra\lib\index.js
- C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\dist\cjs\index.js
- C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\electron\install.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function._load (node:internal/modules/cjs/loader:1055:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16)
    at Object.<anonymous> (C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\node_modules\fs-extra\lib\fs\index.js:5:12)
    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) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\lukes\\OneDrive\\Dokumente\\Entwicklung\\Projekte\\onlook\\node_modules\\@electron\\get\\node_modules\\fs-extra\\lib\\fs\\index.js',
    'C:\\Users\\lukes\\OneDrive\\Dokumente\\Entwicklung\\Projekte\\onlook\\node_modules\\@electron\\get\\node_modules\\fs-extra\\lib\\index.js',
    'C:\\Users\\lukes\\OneDrive\\Dokumente\\Entwicklung\\Projekte\\onlook\\node_modules\\@electron\\get\\dist\\cjs\\index.js',
    'C:\\Users\\lukes\\OneDrive\\Dokumente\\Entwicklung\\Projekte\\onlook\\node_modules\\electron\\install.js'
  ]
}

Node.js v22.14.0

error: postinstall script from "electron" exited with 1```

@lulkebit
Copy link
Author

Okay nevermind, this issue fixed itself after waiting some time and trying again. But I still get the same error as in the beginning

@Kitenite now I run into a different error even after deleting the whole repo and installing it again. I also tried deleting the bun.lock and bun.lockb files but this issue still occurs

$ bun i
bun install v1.2.5 (013fdddc)
⚙️ electron [1/5] node:internal/modules/cjs/loader:1228
throw err;
^

Error: Cannot find module 'graceful-fs'
Require stack:

  • C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules@electron\get\node_modules\fs-extra\lib\fs\index.js
  • C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules@electron\get\node_modules\fs-extra\lib\index.js
  • C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules@electron\get\dist\cjs\index.js
  • C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\electron\install.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function._load (node:internal/modules/cjs/loader:1055:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16)
    at Object. (C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules@electron\get\node_modules\fs-extra\lib\fs\index.js:5:12)
    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) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\node_modules\fs-extra\lib\fs\index.js',
    'C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\node_modules\fs-extra\lib\index.js',
    'C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\@electron\get\dist\cjs\index.js',
    'C:\Users\lukes\OneDrive\Dokumente\Entwicklung\Projekte\onlook\node_modules\electron\install.js'
    ]
    }

Node.js v22.14.0

error: postinstall script from "electron" exited with 1```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants