Newer Version Available

This content describes an older version of this product. View Latest

Install the CLI with npm

If you've installed Node.js on your computer, you can use npm to install the Salesforce CLI. This method lets you install the Salesforce CLI from the command line and can be especially useful for continuous integration (CI) use cases.

Currently, you can install the Salesforce CLI using npm on only macOS or Linux. Check back later for Windows support.

Note

  1. Ensure that Node v8.6.0 or later is installed on your computer. For example, on macOS or Linux:
    1$ node --version
    2v8.6.0
  2. Run this command.
    1$ npm install sfdx-cli --global

    If you receive a permission error when installing the CLI using npm, we recommend not using sudo. See Fixing npm permissions.