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

... Any progress on this ?

karocksjoelee avatar Jun 09 '24 08:06 karocksjoelee

I had the same issue on my Macbook Air M1 running firebase init for an Angular 18 project built with yarn.

I managed to solve it by examining any global packages that might be interfering. Sometimes, global installations can cause conflicts or issues, especially with CLI tools like Firebase.

npm list -g --depth=0

And I went through each of my project-related packages checking and updating to the latest version on npm, like:

npm install -g firebase-tools@latest
npm install -g tsx@latest
npm install -g npm@latest
...

Finally I cleaned up my project by removing node_modules and yarn.lock file to ensure that it takes the latest updates. Working so far to set up my firebase init hosting 💯

CxrlosKenobi avatar Jul 01 '24 18:07 CxrlosKenobi

Hey @FrivalszkyP @karocksjoelee, are you still having this issue? Does @CxrlosKenobi comment helps?

leoortizz avatar Oct 29 '24 19:10 leoortizz

Hey @FrivalszkyP. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Nov 07 '24 02:11 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@FrivalszkyP if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Nov 12 '24 02:11 google-oss-bot