firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Firebase init fails on arm mac

Open FrivalszkyP opened this issue 1 year ago • 2 comments

[REQUIRED] Environment info

firebase --version: 13.7.3

Platform:

macOS: M1 Sonoma Latest npm, pnpm, bun, all of these produce the same issue. Optional dependencies are allowed by default.

[REQUIRED] Test case

Hey folks, I'm running into an issue with my svelte application, although the issue could be related to vite rather than svelte itself. While the application builds successfully, the firebase init command produces an error that seems to have something to do with a rollup dependency missing. The rollup dependency is for darwin architecture but that's not what my platform is using.

See @Startouf's comment here, it describes the same issue.

[REQUIRED] Steps to reproduce

  • npx (or bun) create svelte@latest myapp follow instructions, choose either svelte 4 or 5.
  • firebase init hosting follow instructions

[REQUIRED] Expected behavior

Firebase command succeeds.

[REQUIRED] Actual behavior

[debug] [2024-04-20T15:23:34.001Z] Error: Cannot find module @rollup/rollup-darwin-x64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/Users/freevo/freevo/svelte-5/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/Users/freevo/freevo/svelte-5/node_modules/rollup/dist/native.js:68:76)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._compile (pkg/prelude/bootstrap.js:1890:32)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
[error] 
[error] Error: An unexpected error has occurred.

FrivalszkyP avatar Apr 20 '24 15:04 FrivalszkyP