We all have faced challenges while working in different enterprise environments, where there may be lot of controls/ checks/ red-tape to get by. In such situations, getting access to simple tools (even git) can take lot of time.
Note: This tutorial is to be followed at your own risk, as it may not be complaint to your organization's IT policies.
What is SFDX?
SFDX is a command line utility for managing salesforce builds/ deployments. Being command line, it can be easily embedded to automation chains, to help build fully automated build and deployment processes. To get started, refer https://trailhead.salesforce.com/en/content/learn/trails/sfdx_get_startedSetup SFDX on Windows machine without admin access
As you may have already realized, SFDX installation needs admin access to one's machine. Which may be a luxury a lot of developers may not have. So, i tried to provide a step-by-step guide to setup SFDX on your computer without any admin access
Steps:
Note: The path in commands is provided only for guidance. Ensure, you are using right path, as per your machine's folder structure- Download latest NodeJS Zip file package (v13.1 - https://nodejs.org/dist/v13.1.0/node-v13.1.0-win-x64.zip)
- Unzip folder to desired location. Say
\Tools\nodejs - Note: zip extraction may generate the folder name as per nodejs packaging. In my case, the path was
\Tools\nodejs\node-v13.1.0-win-x64
- Note: zip extraction may generate the folder name as per nodejs packaging. In my case, the path was
- Open command prompt (Win + R; type cmd and press enter)
- Within command prompt navigate to nodejs path (ensure to use correct path no your machine)cd Tools\nodejs\node-v13.1.0-win-x64
- Test if NodeJS works fine. Type following command in command promptnode –vShould display version of nodejs for e.g. v13.1.0
- Run nodevars to setup local variablesnodevars
- Install sfdx command line using NPM (comes along with NodeJS)npm install sfdx-cli –global
- Voilla!! This should result in successful installation of sfdx on your desired folder. To test run this commandsfdx –vIt should result in sfdx version for e.g.sfdx-cli/7.33.2 win32-x64 node-v13.1.0
Note, this does not install sfdx as a global utility i.e. to use sfdx, you have to always provide an absolute path (\Tools\nodejs\node-v13.1.0-win-x64\sfdx) to run the command. However, it does allow you to use SFDX on your machine.
Update : July 21, 2020
If you are facing issues while running SFDX, such as:
- During authentication, Salesforce redirects to a localhost page and is unable to successfully complete authentication process, OR
- after authentication, any server request is blocked
- Org list command (force:org:list) lists down status as "UNABLE _TO_GET_ISSUER_CERT_LOCALLY"
Chances are that there's additional security (probably reverse proxy) implemented, due to which outgoing connections are unable to use required security certifications.
(Can have security issues) You can update nodevars file within nodejs extracted folder to disable TLS check by setting an environment variable. So,
- Locate nodevars.bat within nodejs folder
- Open nodevars.bat file and insert following code in there, preferbly after it sets path
set "NODE_TLS_REJECT_UNAUTHORIZED=0"
Awesome mate, this what I have been looking forever :)
ReplyDelete