How do I best switch versions of sfdx and plugins?

1.9K    Asked by FaithDavidson in AWS , Asked on Jul 8, 2021

When there are bugs in different versions of SFDX CLI and the Plugins: There is a need to switch to another version. But I find uninstalling and re-installing too time consuming. Often people post fixes that refer to a version I am not using, and I wish to give that version a try. I want to know what is the best way to setup my VSCode and install SalesforceDX and SF CLI etc so that if an issue is introduced into the latest version I am using, I can easily switch to and older version to complete a task and then switch back to the new or different version to continue on? Options I am looking at, are: Based on the Windows downloaded installation: Once installed I want to easily version switch and how is it best to do this? Is it by uninstalling or using a contextual menu to version switch?Node Installation. Once installed I want to easily version switch and how is it best to do this? Is it by using node commands to version switch or to use the contextual menu to version switch? Happy to receive answers pertaining to MAC or Linux, but my build is currently Windows. Maybe there is a generic solution for all OSes?

NB: I have noted that when I install with Node using "SFDX update" no longer updates I get a message telling me to use a Node command to update "npm update --global sfdx-cli"


Issues I am experiencing but are not what I am asking about they are for CONTEXT ONLY: SF CLI is not authenticating, so I want to adjust the version i am using to enable the auth until the fix comes out. Retrieving metadata, deploying metadata has inconsistent issues and various metadata are landing in the wrong folders. Was using version 7.89.2. - I upgraded to 7.90.2 and auth issues went away.


Answered by debbie Jha

I suggest using the NPM to install and upgrade for ease of switching between versions.

With this approach, your CLI is not auto upgraded and it is upon you to upgrade by watching the npm registry and reading release notes here. NPM is a package manager for Node.js. You will need to have Node.js latest version installed along with NPM. Install Current Stable Version npm install --global sfdx-cli This is the version that will be most stable and recommended. It is released every week Thursday! It is also possible sometimes if there is a critical bug there is an immediate release (most unlikely) Get a version that is ahead of Stable Version npm install sfdx-cli@latest-rc This version is ahead of the stable version and may have potential bugs that went undiscovered. This is also released weekly on Thursday. The Salesforce CLI team recommends you have a branch in your continuous integration with this version so that any potential bugs are caught and informed to the team before this is released as stable. You can switch to the latest stable version from release candidate simply by doing npm install sfdx-cli@latest Install a specific version npm install --global sfdx-cli@ You can obtain the version number from here example npm install --global sfdx-cli@7.90.1 Uninstall At any point you want to uninstall the CLI, you can do using below npm uninstall sfdx-cli --global The other thing to note is Salesforce CLI is made of a number of core plugins. If you wish to update one of those, say an example salesforce dx plugin then the command is below sfdx plugins:install salesforcedx@latest-rc I highly recommend not to individually try to change versions of these plugins unless you know what you are doing.



Your Answer

Interviews

Parent Categories