Since this morning, when I try to run sfdx force:org:* commands, I get the error :

TypeError: (intermediate value).getNumber is not a function

Yesterday everything worked fine and I did nothing else than shut down my computer and restart it this morning. As it's running Linux (Debian), I don't expect any unsollicited update to break the system...

$ sfdx force:org:open -u scratch_1
TypeError: (intermediate value).getNumber is not a function

$ sfdx force:org:list
TypeError: (intermediate value).getNumber is not a function

However commands in other namespaces are still working :

$ sfdx force:user:list
=== Users in org 00D1j0000002BWBEA2
Default  Alias        Username                       Profile Name          User Id
───────  ───────────  ─────────────────────────────  ────────────────────  ──────────────────
(A)      scratch_1    test-ktkyzd8dpt8g@example.com  System Administrator  0051j000005vzAfAAI

I've tried so far :

  • sfdx update
  • reinstall plugins with sfdx plugins:install salesforcedx and sfdx plugins:install sfdx-cli
  • delete /usr/local/lib/sfdx directory and resintall from the sources I initially used (sfdx-cli-v7.8.1-8f830784cc-linux-x64)
  • update nodejs to the latest version
  • delete /usr/local/lib/sfdx directory and resintall from the last sources I downloaded today (sfdx-cli-v7.85.1-2fb9e41053-darwin-x64)
  • delete /usr/local/lib/sfdx directory and resintall with npm install sfdx-cli --global

Nothing helped, here is my actual version :

$sfdx --version
sfdx-cli/7.86.3 linux-x64 node-v15.8.0
$ sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.7 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 50.16.1
├─ limits 1.0.3
├─ schema 1.0.3
├─ user 1.0.11
├─ apex 0.1.4
├─ custom-metadata 1.0.11
├─ templates 50.4.0
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
└─ salesforce-alm 50.16.1
sfdx-cli 7.86.3 (core)
telemetry 1.0.1 (core)

Don't know what else to try, any lead would be much appreciated !

[ edit ]

Looking at the code of sfdx, I found the getNumber function in sfdx-cli/node_modules/salesforce-alm/node_modules/@salesforce/ts-types/lib/narrowing/get.js.

Now the hard part is to find what the (intermediate value) is...

Just tried to remove the ~/.sfdx directory and nothing still changed. So it's neither my sfdx conf nor a problem with my orgs. I'm stuck, gonna try to copy my workspace and .sfdx to my Windows environment, I think that should let me work...

  • 1
    I've seen issues with sfdx CLI using an external Node.js install compared with its own embedded version. Have you tried to let sfdx use its own Node.js?
    – Phil W
    Feb 7 at 11:20
  • I think it did when I ran the packaged versions (7.8.1 and 7.85.1) Feb 7 at 11:28
  • 1
    any chance your org went spring'21 overnight? Not sure how this could cause it, but worth looking at it as a variable
    – Nick Cook
    Feb 7 at 11:48
  • I don't know, I don't have a password to connect to my org since I always used force:org:open. However since I get the same error running force:org:create I think it's not related to the org. Feb 7 at 11:57
  • try an earlier version of cli .... i am guessing it should be a problem with that version of cli Feb 7 at 13:17

Commands that I execute to fix the issue:

  1. sfdx plugins:uninstall salesforcedx
  2. npm uninstall sfdx-cli --global
  3. npm install sfdx-cli --global
  4. sfdx update

These commands are for windows, if you are on mac check: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_macos

  • I didn't have a chance to try this exactly yet, I will. However I think you should run step 2 before step 1... Once uninstalled sfdx it might be hard to run it ;) Feb 17 at 7:12
  • Thanks Jojosfdc, it finally works ! Maybe removing usr/local/lib/sfdx dir is not exactly the same as running npm uninstall, or they fixed something in the meantime... Feb 20 at 8:58
  • Note that I also reintalled npm, before I ran those commands, don't know if it helped. Feb 20 at 9:00
  1. we do have a rewrite of 3 org:open/display/list https://github.com/forcedotcom/cli/issues/835. I'd like to see that they don't have the error since it's up for release soon.

  2. We've seen some issues with the old org commands using node15 in our unit tests. If you have the ability (using nvm or the like) to try running on node LTS (14.16.0 currently) and see if that makes a difference.

  3. For anyone seeing bugs like this in the CLI, github issues is monitored by the CLI team and is a good place to report stuff. I <3 SFSE but we don't give it the same level of attention. Cross-posting is cool, too. https://github.com/forcedotcom/cli/issues

  • Hi Shane I'd be glad to help by running tests but since I reinstalled everything and the problem is solved I'm afraid I would'nt know how to reproduce it. Mar 14 at 8:24

I faced the same problem. I uninstall CLI and did the clean install and it helped.

  • Thanks for your answer. It didn't help for me, even trying 3 different versions... Feb 17 at 7:10

I've downgraded my CLI and that worked around for now. It really looks like a sfdx bug.

I did tried a more recent one first, but got the same error. Ultimately, I landed on:

sfdx plugins:install salesforcedx@50.7.1

This got me a bunch of errors like this:

Entity of type 'ListView' named 'ProductServiceCampaignItem.My_ProductServiceCampaignItems' cannot be found
Entity of type 'ListView' named 'ProductServiceCampaignItem.My_RecentProductServiceCampaignItems' cannot be found
Entity of type 'ListView' named 'ShiftTemplate.My_RecentShiftTemplates' cannot be found
Entity of type 'ListView' named 'ProductServiceCampaignItem.All_ProductServiceCampaignItems' cannot be found
Entity of type 'ListView' named 'ShiftTemplate.My_ShiftTemplates' cannot be found
Entity of type 'ListView' named 'ShiftTemplate.All_ShiftTemplates' cannot be found

Which I resolved by adding each named item to .forceignore as per this question: SFDX Pull error: Entity of type 'ListView' named XXX cannot be found

  • yes I got that one too and added objects to forceignore. Feb 17 at 14:01
  • please can you tell which version of the cli was working ? Feb 17 at 14:02
  • 1
    It was the 50.7.1 that worked for me, downgraded from 50.16.1 that was the one where I was getting the error from your question
    – Aidan
    Feb 17 at 14:28
  • Well thanks Aidan but it didn't work for me... Feb 20 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.