I am seeking to set up flutter on the web with firebase. I have followed the steps on the firebase website
I have installed Firebase CLI and then I run
- firebase login
- Then I run firebase init hosting and select "Use an existing project" but
I get this error:
(node:41671) [DEP0044] DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
ERROR after selection of existing project
I have removed Node.js and reinstalled (using homebrew) hoping it would fix the error, but it remains.
Note I also get a warning after each prompt above, which I suspect could be related to my issue, but cannot resolve either:
(node:41671) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
2
Answers
Note sure what was causing the error, but I finally got working after removing node.js following steps from this post remove node.js
Then reinstalling following these steps: install firebase with flutter
Was able to remove the ‘DeprecationWarning’ error by changing my current Node.js version using NVM.
Originally I was using Node version 22.3.0 (
nvm current
) but Firebase Cloud Functions documentation mentioned that FirebaseCLI fully supports Node v18 and v20 with only preview-level support of v22 (https://firebase.google.com/docs/functions/get-started?gen=2nd#set-up-your-environment-and-the-firebase-cli)(1) Used NVM to install latest Node version
nvm install --lts
(2) Used NVM to switch to latest Node version
nvm use --lts
(3) Confirmed Node was v20
node --version
(4) Re-authenticated my Firebase login using Google Oauth2
firebase logout {google email}
thenfirebase login
to authenticate via web browser(5) Successfully initialized firestore within a current firebase project without any ‘DeprecationWarning’ errors
firebase init firestore