You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
is:npm hidden command is broken due to invalid config arguments (duplicate config) #6132
I'm using the (hidden) is:npm function to check the latest available version of firebase-tools in my Github action.
I understand that this might be a bit on the edge of supported, however the is:npm function in firepit seems broken at the moment, which is probably not intended :)
[REQUIRED] Environment info
firebase-tools:
firebase-tools standalone 12.4.4
Platform:
ubuntu, did not test on other platforms, but could be equally affected.
[REQUIRED] Test case
run firebase is:npm
[REQUIRED] Steps to reproduce
run firebase is:npm
[REQUIRED] Expected behavior
Calls the embedded npm
[REQUIRED] Actual behavior
Returns an error similar to
Error: double-loading config "/home/botteaap/.cache/firebase/runtime/npmrc" as "global", previously loaded as "user"
at Config.#loadObject (/snapshot/firepit/node_modules/npm/node_modules/@npmcli/config/lib/index.js:571:13)
at /snapshot/firepit/node_modules/npm/node_modules/@npmcli/config/lib/index.js:617:31
at async Config.#loadFile (/snapshot/firepit/node_modules/npm/node_modules/@npmcli/config/lib/index.js:616:5)
at async Config.load (/snapshot/firepit/node_modules/npm/node_modules/@npmcli/config/lib/index.js:287:5)
at async Npm.#load (/snapshot/firepit/node_modules/npm/lib/npm.js:195:5)
at async /snapshot/firepit/node_modules/npm/lib/cli-entry.js:40:5
Reacted by Victor, Cristiano Becker, Raymond Price, Alessandro Fulgini, Timo Schlößer, DR, Samuel Ngoma, Matt Johnson, Sophoun Nheum, Paul Frischknecht and 1 more
Actually, this seems a bit more severe as I'm also seeing the same error when running firebase deploy with the standalone version (at the point where it's calling out to run npm run lint)
I've downgraded to 12.4.3 which doesn't have this bug. I also reproduced this on mac os in the mean time. My function deploys were failing with 12.4.4 because of this too.
Reacted by Victor, John Dunne, Anoop Mohandas, Timo Schlößer, terasaka, Yaovi Emmanuel Josué Djossou and Trevor Delamorandiere
😕 I'm experiencing the same issue as well. I was really looking forward to testing out the new v2, but unfortunately, I'm encountering difficulties deploying the function.
I was attempting a PR to fix this, but it seems like bumping the npm dependency is the root cause (v12.4.3...v12.4.4#diff-c9a00aafb0c4dc8ec395ea49f9fbb6482f757b31adee758cb59ad4e27118ae52). Even if I remove the duplicate config line that I linked to, I'm not getting any output running firebase is:npm help. When I downgrade the npm dependency things start working again. @joehan I hope you have any ideas and that this info is useful to you?
Digging a bit deeper, there are errors when running the npm pkg step. Those in turn are related to vercel/pkg#1291. The newer npm dependency uses esm modules. What seems to be happening is that not all dependencies used for the npm cli are compiled correctly, hence the broken npm. The built-in node version using is:node also seems broken by the way.
--edit-- I looked further into this, and the repackaged npm is indeed broken and throws an exception that is normally not shown. Tried some things to fix that packaging but I nothing that is working yet.
I guess the short term solution would be to revert the npm dependency bump which would unbreak standalone versions of firebase-tools after 12.4.3.
@hvisser Thanks for all the research into this, I'm looking into a fix now (hopefully without going all the way back to npm 6.x). Apologies for the delay on this - I had deprioritized it in my head since is:npm isn't an officially supported command, but since this seems to affect any call to npm from the standalone version of the CLI, it is much more concerning.
I've downgraded to 12.4.3 which doesn't have this bug. I also reproduced this on mac os in the mean time. My function deploys were failing with 12.4.4 because of this too.
Hey @eszabo12 - this issue was fixed in 12.6.0. Please update to a more recent version of firebase-tools.
I ran npm update -g firebase-tools
and am now getting this:
firebase --version
This tool has encountered an error. Please file a bug on Github (https://github.com/firebase/firebase-tools/) and include firepit-log.txt
so it only runs with "sudo" prepended. Now am no longer getting the dual config error but instead this
Activity
hvisser commentedon Jul 13, 2023
Actually, this seems a bit more severe as I'm also seeing the same error when running
firebase deploywith the standalone version (at the point where it's calling out to runnpm run lint)VictorUvarov commentedon Jul 19, 2023
Is there a temporary workaround to this issue? Should I downgrade
firebase-tools?hvisser commentedon Jul 19, 2023
I've downgraded to 12.4.3 which doesn't have this bug. I also reproduced this on mac os in the mean time. My function deploys were failing with 12.4.4 because of this too.
hvisser commentedon Aug 8, 2023
Any updates on this maybe? I'm stuck on 12.4.3 because my functions do not deploy with the the firepit version.
cookii-king commentedon Aug 18, 2023
😕 I'm experiencing the same issue as well. I was really looking forward to testing out the new v2, but unfortunately, I'm encountering difficulties deploying the function.
hvisser commentedon Aug 21, 2023
I was attempting a PR to fix this, but it seems like bumping the
npmdependency is the root cause (v12.4.3...v12.4.4#diff-c9a00aafb0c4dc8ec395ea49f9fbb6482f757b31adee758cb59ad4e27118ae52). Even if I remove the duplicate config line that I linked to, I'm not getting any output runningfirebase is:npm help. When I downgrade thenpmdependency things start working again. @joehan I hope you have any ideas and that this info is useful to you?@cookii-king The only workaround so far, if you want to use the standalone version of the firebase cli, is to stick to version 12.4.3 https://firebase.tools/ has instructions on how to get a specific version. The version installed through npm doesn't have this issue (I think, I hope 😅 )
hvisser commentedon Aug 21, 2023
Digging a bit deeper, there are errors when running the
npm pkgstep. Those in turn are related to vercel/pkg#1291. The newernpmdependency uses esm modules. What seems to be happening is that not all dependencies used for the npm cli are compiled correctly, hence the brokennpm. The built-in node version usingis:nodealso seems broken by the way.--edit-- I looked further into this, and the repackaged npm is indeed broken and throws an exception that is normally not shown. Tried some things to fix that packaging but I nothing that is working yet.
I guess the short term solution would be to revert the npm dependency bump which would unbreak standalone versions of
firebase-toolsafter12.4.3.joehan commentedon Aug 25, 2023
@hvisser Thanks for all the research into this, I'm looking into a fix now (hopefully without going all the way back to npm 6.x). Apologies for the delay on this - I had deprioritized it in my head since
is:npmisn't an officially supported command, but since this seems to affect any call to npm from the standalone version of the CLI, it is much more concerning.hvisser commentedon Aug 25, 2023
Thanks @joehan I didn't realise that either when I filed the issue initially, so I completely understand.
Masterxilo commentedon Sep 3, 2023
I had the same problem today. Installing via "curl -sL https://firebase.tools | bash" we apparently still get a bad version...
joehan commentedon Sep 5, 2023
@Masterxilo There has not been a new version released since we fixed this bug, so that is expected. This should be resolved in the next version
hvisser commentedon Sep 17, 2023
@joehan Turns out this is not completely fixed, see PR #6367. LMK if you need a separate issue for that too.
gkhnyrdm commentedon Sep 22, 2023
anyone fix this issue?
tdelam commentedon Sep 25, 2023
Receiving this issue as well
node --version && firebase --versionv20.5.0 12.5.2tdelam commentedon Sep 25, 2023
This worked for me too.
elleszabo commentedon Dec 25, 2023
getting this with node --version && firebase --version
v21.5.0
12.4.7
joehan commentedon Dec 26, 2023
Hey @eszabo12 - this issue was fixed in 12.6.0. Please update to a more recent version of firebase-tools.
elleszabo commentedon Dec 27, 2023
I ran
npm update -g firebase-toolsand am now getting this:
so it only runs with "sudo" prepended. Now am no longer getting the dual config error but instead this

joehan commentedon Dec 28, 2023
@eszabo12 Since that's a different error, could you open a new issue and include the
firepit-log.txtfile? It will be difficult to help otherwise.