Set Up Your Developer Environment
Before you generate a new Salesforce plugin, complete these prerequisites.
-
Install or update Node.js.
To build a Salesforce CLI plugin, you need the latest long-term support (LTS) version of Node.js. See Download Node.js for more information. If you’re new to Node.js development, we suggest that you use nvm (Node Version Manager) to install Node.js. See this installation script to install or update nvm.
To check your Node.js version, run:
If your node version is earlier than the current or Active LTS version, or if you don’t have Node.js installed, run this command to install LTS:
Then run this command to make sure nvm always loads the installed LTS version in new terminals:
-
Install the Yarn package manager.
-
Install TypeScript (target es2017.)
Salesforce CLI plugins can use JavaScript instead of TypeScript, but the classes in the Salesforce DX core library are written in TypeScript.
-
Install or update Salesforce CLI using
npm
.If you don’t have Salesforce CLI installed on your computer, see Install Salesforce CLI and follow the instructions in the Install the CLI with npm section. To make sure you're always up to date with Salesforce CLI, run this
npm
command to install the latest version. -
Install Visual Studio Code (VS Code) with the Salesforce Extensions pack as your IDE. While you can use any IDE, we highly recommend VS Code because it includes tools for developing on the Salesforce platform.