Newer Version Available
Update Salesforce CLI
Determine How You Installed Salesforce CLI
Because the method to update Salesforce CLI differs depending on whether you used the installers or npm, you must know how you installed before you can update. In case you forgot, here are two ways to determine how you installed Salesforce CLI:
- Run sf update. If Salesforce CLI updates, then you
installed with the installers. If the command returns this or similar warning, then you
installed with npm:
1sf update 2 › Warning: Use "npm update --global @salesforce/cli" to update npm-based installations. 3@salesforce/cli: Updating CLI... not updatable - If you’ve installed Node.js, run npm list -g --depth 0. If the displayed list includes the entry @salesforce/cli@<version>, then you installed Salesforce CLI with npm.
If You Installed Salesforce CLI Using the Installer
1sf updateBy default, the CLI periodically checks for and installs updates. To disable auto-update, set the SF_AUTOUPDATE_DISABLE environment variable to true.
When you update Salesforce CLI, we automatically display the release notes for the version you're updating to so you can learn about the new, changed, and fixed features. To silence the display, set the SF_HIDE_RELEASE_NOTES and SF_HIDE_RELEASE_NOTES_FOOTER environment variables to true.
If You Installed Salesforce CLI Using npm
1npm install --global @salesforce/cliDisable Automatic Update of the CLI
To remain on the current version of the CLI and disable automatic updates, set the SF_AUTOUPDATE_DISABLE environment variable to true. How you set an environment variable is different for different operating systems. See the operating system vendor’s help for instructions on how to set environment variables.